YAML Examples : Create Jar using maven , azure devops

#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’

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
sandeep negi

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