Articles → AZURE DEVOPS → Create The Java Build Pipeline Using The Self-Hosted Agent In Azure Devops

Create The Java Build Pipeline Using The Self-Hosted Agent In Azure Devops






Creation Of Environment For Self-Hosted Agent




  1. JDK (latest version)
  2. Maven (https://maven.apache.org/download.cgi)
Picture showing the maven portal for downloading the maven
Click to Enlarge



Picture showing adding the MAVEN_HOME and JAVA_HOME in environmental variables
Click to Enlarge



Picture showing adding the path of JDK and maven in path in environmental variables
Click to Enlarge


Adding Code In The Repository






Picture showing the java code in the Azure DevOps repository
Click to Enlarge


Change In Pom.Xml




	<?xml version="1.0" encoding="UTF-8"?><project
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.springframework.samples</groupId><artifactId>spring-framework-petclinic</artifactId><version>5.1.3</version></project>



Edit The Pipeline




  1. Maven
  2. Copy Files To
  3. Publish Artifacts
Picture showing adding the Maven, Copy Files To and Publish artifacts task in pipeline
Click to Enlarge



Picture showing specifying the maven path in Maven pom.xml
Click to Enlarge



Picture showing changing the contents of Copy Files to: $(Build.ArtifactStagingDirectory)
Click to Enlarge



Picture showing the execution status of the build
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, July 16, 2021

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250