Skip to content

Instantly share code, notes, and snippets.

@CedricL46
Last active February 26, 2020 15:27
Show Gist options
  • Save CedricL46/a2bce9ff5e5c45fc0a2aeaaec2ee2ee2 to your computer and use it in GitHub Desktop.
Save CedricL46/a2bce9ff5e5c45fc0a2aeaaec2ee2ee2 to your computer and use it in GitHub Desktop.
# Maven package Java
# Build your Java project
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- master
variables:
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build stage
jobs:
- job: MavenPackageAndPublishArtifacts
displayName: Maven Package and Publish Artifacts
pool:
vmImage: $(vmImageName)
steps:
- task: Maven@3
displayName: 'Maven Package'
inputs:
mavenPomFile: 'pom.xml'
- task: CopyFiles@2
displayName: 'Copy Files to artifact staging directory'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/target/*.?(war|jar)'
TargetFolder: $(Build.ArtifactStagingDirectory)
- upload: $(Build.ArtifactStagingDirectory)
artifact: drop
- Save and run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment