YAML Examples : Create Jar using maven , azure devops

sandeep negi
May 26, 2021

--

#Your build pipeline references an undefined variable named ‘Parameters.mavenPOMFile’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

steps:
- task: Maven@3
displayName: ‘Maven pom.xml’
inputs:
mavenPomFile: ‘$(Parameters.mavenPOMFile)’
goals: ‘clean compile assembly:single’

Copy the JAR to STAGING

steps:
- task: CopyFiles@2
displayName: ‘Copy Files to: $(Build.ArtifactStagingDirectory)’
inputs:
SourceFolder: ‘$(system.defaultworkingdirectory)’
Contents: ‘**/*.jar’
TargetFolder: ‘$(Build.ArtifactStagingDirectory)’
condition: succeededOrFailed()

Use Windows Task to copy files from local storage to shared network location

// copy from build server to network location

steps:
- task: WindowsMachineFileCopy@2
displayName: ‘Copy files from local to shared location’
inputs:
SourcePath: ‘$(Build.ArtifactStagingDirectory)’
MachineNames: machine_name
AdminUserName: ‘domain\username’
AdminPassword: ‘password_without_encoding’
TargetPath: ‘\\complete_shared_path_location’

--

--

sandeep negi

Software Engineer, who loves challenges and new technologies. :)