代码拉取完成,页面将自动刷新
# Maven
# Build your Java project and run tests with Apache Maven.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
#- master
- releases/*
strategy:
matrix:
jdk10_linux:
imageName: "ubuntu-latest"
jdk_version: "1.10"
#jdk11_windows:
# imageName: "windows-latest"
# jdk_version: "1.11"
maxParallel: 1
pool:
vmImage: $(imageName)
steps:
- task: SonarQubePrepare@5
inputs:
SonarQube: 'sonarqube'
scannerMode: 'Other'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
# sonar.exclusions=**/*.bin
sonar.projectKey=Devops_Demo_web
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: MavenAuthenticate@0
inputs:
artifactsFeeds: 'yuanpeng002'
- task: Maven@3
inputs:
mavenPomFile: 'pom.xml'
publishJUnitResults: true
testResultsFiles: '**/surefire-reports/TEST-*.xml'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.11'
mavenVersionOption: 'Default'
mavenOptions: '-Xmx3072m'
mavenAuthenticateFeed: false
effectivePomSkip: false
sonarQubeRunAnalysis: true
sqMavenPluginVersionChoice: 'latest'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: "JaCoCo"
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/site/jacoco/jacoco.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/site/jacoco"
failIfCoverageEmpty: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
mergeTestResults: true
- task: Bash@3
inputs:
targetType: 'inline'
script: |
# Write your commands here
echo 'Hello world'
- task: CopyFiles@2
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: '**/*.war'
TargetFolder: '$(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(imageName)'
publishLocation: 'Container'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。