共用方式為


Maven@2 - Maven v2 工作

使用此工作來建置、測試及部署Apache Maven。

Syntax

# Maven v2
# Build, test, and deploy with Apache Maven.
- task: Maven@2
  inputs:
    mavenPOMFile: 'pom.xml' # string. Required. Maven POM file. Default: pom.xml.
    #goals: 'package' # string. Goal(s). Default: package.
    #options: # string. Options. 
  # JUnit Test Results
    #publishJUnitResults: true # boolean. Publish to Azure Pipelines. Default: true.
    testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test results files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test run title. 
    #allowBrokenSymlinks: true # boolean. Alias: allowBrokenSymbolicLinks. Optional. Use when publishJUnitResults = true. Allow broken symbolic links. Default: true.
  # Code Coverage
    #codeCoverageToolOption: 'None' # 'None' | 'Cobertura' | 'JaCoCo'. Alias: codeCoverageTool. Code coverage tool. Default: None.
    #codeCoverageClassFilter: # string. Alias: classFilter. Optional. Use when codeCoverageTool != None. Class inclusion/exclusion filters. 
    #codeCoverageClassFilesDirectories: # string. Alias: classFilesDirectories. Optional. Use when codeCoverageTool = JaCoCo. Class files directories. 
    #codeCoverageSourceDirectories: # string. Alias: srcDirectories. Optional. Use when codeCoverageTool = JaCoCo. Source files directories. 
    #codeCoverageFailIfEmpty: false # boolean. Alias: failIfCoverageEmpty. Optional. Use when codeCoverageTool != None. Fail when code coverage results are missing. Default: false.
    #codeCoverageRestoreOriginalPomXml: false # boolean. Alias: restoreOriginalPomXml. Optional. Use when codeCoverageTool != None. Restore original pom.xml after task execution. Default: false.
  # Advanced
    javaHomeOption: 'JDKVersion' # 'JDKVersion' | 'Path'. Alias: javaHomeSelection. Required. Set JAVA_HOME by. Default: JDKVersion.
    #jdkVersionOption: 'default' # 'default' | '1.17' | '1.11' | '1.10' | '1.9' | '1.8' | '1.7' | '1.6'. Alias: jdkVersion. Optional. Use when javaHomeSelection = JDKVersion. JDK version. Default: default.
    #jdkDirectory: # string. Alias: jdkUserInputPath. Required when javaHomeSelection = Path. JDK path. 
    #jdkArchitectureOption: 'x64' # 'x86' | 'x64'. Alias: jdkArchitecture. Optional. Use when jdkVersion != default. JDK architecture. Default: x64.
    mavenVersionOption: 'Default' # 'Default' | 'Path'. Alias: mavenVersionSelection. Required. Maven version. Default: Default.
    #mavenDirectory: # string. Alias: mavenPath. Required when mavenVersionSelection = Path. Maven path. 
    #mavenSetM2Home: false # boolean. Optional. Use when mavenVersionSelection = Path. Set M2_HOME variable. Default: false.
    #mavenOptions: '-Xmx1024m' # string. Alias: mavenOpts. Set MAVEN_OPTS to. Default: -Xmx1024m.
    #mavenAuthenticateFeed: true # boolean. Alias: mavenFeedAuthenticate. Authenticate with Artifacts feeds. Default: true.
  # Code Analysis
    #sonarQubeRunAnalysis: false # boolean. Alias: sqAnalysisEnabled. Run SonarQube or SonarCloud analysis. Default: false.
    #isJacocoCoverageReportXML: false # boolean. Optional. Use when sqAnalysisEnabled = true && codeCoverageTool = JaCoCo. Use XML Jacoco reports for SonarQube analysis. Default: false.
    #sqMavenPluginVersionChoice: 'latest' # 'latest' | 'pom'. Required when sqAnalysisEnabled = true. SonarQube scanner for Maven version. Default: latest.
    #checkStyleRunAnalysis: false # boolean. Alias: checkstyleAnalysisEnabled. Run Checkstyle. Default: false.
    #pmdRunAnalysis: false # boolean. Alias: pmdAnalysisEnabled. Run PMD. Default: false.
    #findBugsRunAnalysis: false # boolean. Alias: findbugsAnalysisEnabled. Run FindBugs. Default: false.
# Maven v2
# Build, test, and deploy with Apache Maven.
- task: Maven@2
  inputs:
    mavenPOMFile: 'pom.xml' # string. Required. Maven POM file. Default: pom.xml.
    #goals: 'package' # string. Goal(s). Default: package.
    #options: # string. Options. 
  # JUnit Test Results
    #publishJUnitResults: true # boolean. Publish to Azure Pipelines. Default: true.
    testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test results files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test run title. 
    #allowBrokenSymlinks: true # boolean. Alias: allowBrokenSymbolicLinks. Optional. Use when publishJUnitResults = true. Allow broken symbolic links. Default: true.
  # Code Coverage
    #codeCoverageToolOption: 'None' # 'None' | 'Cobertura' | 'JaCoCo'. Alias: codeCoverageTool. Code coverage tool. Default: None.
    #codeCoverageClassFilter: # string. Alias: classFilter. Optional. Use when codeCoverageTool != None. Class inclusion/exclusion filters. 
    #codeCoverageClassFilesDirectories: # string. Alias: classFilesDirectories. Optional. Use when codeCoverageTool = JaCoCo. Class files directories. 
    #codeCoverageSourceDirectories: # string. Alias: srcDirectories. Optional. Use when codeCoverageTool = JaCoCo. Source files directories. 
    #codeCoverageFailIfEmpty: false # boolean. Alias: failIfCoverageEmpty. Optional. Use when codeCoverageTool != None. Fail when code coverage results are missing. Default: false.
    #codeCoverageRestoreOriginalPomXml: false # boolean. Alias: restoreOriginalPomXml. Optional. Use when codeCoverageTool != None. Restore original pom.xml after task execution. Default: false.
  # Advanced
    javaHomeOption: 'JDKVersion' # 'JDKVersion' | 'Path'. Alias: javaHomeSelection. Required. Set JAVA_HOME by. Default: JDKVersion.
    #jdkVersionOption: 'default' # 'default' | '1.17' | '1.11' | '1.10' | '1.9' | '1.8' | '1.7' | '1.6'. Alias: jdkVersion. Optional. Use when javaHomeSelection = JDKVersion. JDK version. Default: default.
    #jdkDirectory: # string. Alias: jdkUserInputPath. Required when javaHomeSelection = Path. JDK path. 
    #jdkArchitectureOption: 'x64' # 'x86' | 'x64'. Alias: jdkArchitecture. Optional. Use when jdkVersion != default. JDK architecture. Default: x64.
    mavenVersionOption: 'Default' # 'Default' | 'Path'. Alias: mavenVersionSelection. Required. Maven version. Default: Default.
    #mavenDirectory: # string. Alias: mavenPath. Required when mavenVersionSelection = Path. Maven path. 
    #mavenSetM2Home: false # boolean. Optional. Use when mavenVersionSelection = Path. Set M2_HOME variable. Default: false.
    #mavenOptions: '-Xmx1024m' # string. Alias: mavenOpts. Set MAVEN_OPTS to. Default: -Xmx1024m.
    #mavenAuthenticateFeed: true # boolean. Alias: mavenFeedAuthenticate. Authenticate built-in Maven feeds. Default: true.
  # Code Analysis
    #sonarQubeRunAnalysis: false # boolean. Alias: sqAnalysisEnabled. Run SonarQube or SonarCloud analysis. Default: false.
    #isJacocoCoverageReportXML: false # boolean. Optional. Use when sqAnalysisEnabled = true && codeCoverageTool = JaCoCo. Use XML Jacoco reports for SonarQube analysis. Default: false.
    #sqMavenPluginVersionChoice: 'latest' # 'latest' | 'pom'. Required when sqAnalysisEnabled = true. SonarQube scanner for Maven version. Default: latest.
    #checkStyleRunAnalysis: false # boolean. Alias: checkstyleAnalysisEnabled. Run Checkstyle. Default: false.
    #pmdRunAnalysis: false # boolean. Alias: pmdAnalysisEnabled. Run PMD. Default: false.
    #findBugsRunAnalysis: false # boolean. Alias: findbugsAnalysisEnabled. Run FindBugs. Default: false.
# Maven v2
# Build, test, and deploy with Apache Maven.
- task: Maven@2
  inputs:
    mavenPOMFile: 'pom.xml' # string. Required. Maven POM file. Default: pom.xml.
    #goals: 'package' # string. Goal(s). Default: package.
    #options: # string. Options. 
  # JUnit Test Results
    #publishJUnitResults: true # boolean. Publish to Azure Pipelines. Default: true.
    testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test results files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test run title. 
  # Code Coverage
    #codeCoverageToolOption: 'None' # 'None' | 'Cobertura' | 'JaCoCo'. Alias: codeCoverageTool. Code coverage tool. Default: None.
    #codeCoverageClassFilter: # string. Alias: classFilter. Optional. Use when codeCoverageTool != None. Class inclusion/exclusion filters. 
    #codeCoverageClassFilesDirectories: # string. Alias: classFilesDirectories. Optional. Use when codeCoverageTool = JaCoCo. Class files directories. 
    #codeCoverageSourceDirectories: # string. Alias: srcDirectories. Optional. Use when codeCoverageTool = JaCoCo. Source files directories. 
    #codeCoverageFailIfEmpty: false # boolean. Alias: failIfCoverageEmpty. Optional. Use when codeCoverageTool != None. Fail when code coverage results are missing. Default: false.
    #codeCoverageRestoreOriginalPomXml: false # boolean. Alias: restoreOriginalPomXml. Optional. Use when codeCoverageTool != None. Restore original pom.xml after task execution. Default: false.
  # Advanced
    javaHomeOption: 'JDKVersion' # 'JDKVersion' | 'Path'. Alias: javaHomeSelection. Required. Set JAVA_HOME by. Default: JDKVersion.
    #jdkVersionOption: 'default' # 'default' | '1.11' | '1.10' | '1.9' | '1.8' | '1.7' | '1.6'. Alias: jdkVersion. Optional. Use when javaHomeSelection = JDKVersion. JDK version. Default: default.
    #jdkDirectory: # string. Alias: jdkUserInputPath. Required when javaHomeSelection = Path. JDK path. 
    #jdkArchitectureOption: 'x64' # 'x86' | 'x64'. Alias: jdkArchitecture. Optional. Use when jdkVersion != default. JDK architecture. Default: x64.
    mavenVersionOption: 'Default' # 'Default' | 'Path'. Alias: mavenVersionSelection. Required. Maven version. Default: Default.
    #mavenDirectory: # string. Alias: mavenPath. Required when mavenVersionSelection = Path. Maven path. 
    #mavenSetM2Home: false # boolean. Optional. Use when mavenVersionSelection = Path. Set M2_HOME variable. Default: false.
    #mavenOptions: '-Xmx1024m' # string. Alias: mavenOpts. Set MAVEN_OPTS to. Default: -Xmx1024m.
    #mavenAuthenticateFeed: true # boolean. Alias: mavenFeedAuthenticate. Authenticate built-in Maven feeds. Default: true.
  # Code Analysis
    #sonarQubeRunAnalysis: false # boolean. Alias: sqAnalysisEnabled. Run SonarQube or SonarCloud analysis. Default: false.
    #isJacocoCoverageReportXML: false # boolean. Optional. Use when sqAnalysisEnabled = true && codeCoverageTool = JaCoCo. Use XML Jacoco reports for SonarQube analysis. Default: false.
    #sqMavenPluginVersionChoice: 'latest' # 'latest' | 'pom'. Required when sqAnalysisEnabled = true. SonarQube scanner for Maven version. Default: latest.
    #checkStyleRunAnalysis: false # boolean. Alias: checkstyleAnalysisEnabled. Run Checkstyle. Default: false.
    #pmdRunAnalysis: false # boolean. Alias: pmdAnalysisEnabled. Run PMD. Default: false.
    #findBugsRunAnalysis: false # boolean. Alias: findbugsAnalysisEnabled. Run FindBugs. Default: false.
# Maven v2
# Build, test, and deploy with Apache Maven.
- task: Maven@2
  inputs:
    mavenPOMFile: 'pom.xml' # string. Required. Maven POM file. Default: pom.xml.
    #goals: 'package' # string. Goal(s). Default: package.
    #options: # string. Options. 
  # JUnit Test Results
    #publishJUnitResults: true # boolean. Publish to Azure Pipelines. Default: true.
    testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test results files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test run title. 
  # Code Coverage
    #codeCoverageToolOption: 'None' # 'None' | 'Cobertura' | 'JaCoCo'. Alias: codeCoverageTool. Code coverage tool. Default: None.
    #codeCoverageClassFilter: # string. Alias: classFilter. Optional. Use when codeCoverageTool != None. Class inclusion/exclusion filters. 
    #codeCoverageClassFilesDirectories: # string. Alias: classFilesDirectories. Optional. Use when codeCoverageTool = JaCoCo. Class files directories. 
    #codeCoverageSourceDirectories: # string. Alias: srcDirectories. Optional. Use when codeCoverageTool = JaCoCo. Source files directories. 
    #codeCoverageFailIfEmpty: false # boolean. Alias: failIfCoverageEmpty. Optional. Use when codeCoverageTool != None. Fail when code coverage results are missing. Default: false.
  # Advanced
    javaHomeOption: 'JDKVersion' # 'JDKVersion' | 'Path'. Alias: javaHomeSelection. Required. Set JAVA_HOME by. Default: JDKVersion.
    #jdkVersionOption: 'default' # 'default' | '1.11' | '1.10' | '1.9' | '1.8' | '1.7' | '1.6'. Alias: jdkVersion. Optional. Use when javaHomeSelection = JDKVersion. JDK version. Default: default.
    #jdkDirectory: # string. Alias: jdkUserInputPath. Required when javaHomeSelection = Path. JDK path. 
    #jdkArchitectureOption: 'x64' # 'x86' | 'x64'. Alias: jdkArchitecture. Optional. Use when jdkVersion != default. JDK architecture. Default: x64.
    mavenVersionOption: 'Default' # 'Default' | 'Path'. Alias: mavenVersionSelection. Required. Maven version. Default: Default.
    #mavenDirectory: # string. Alias: mavenPath. Required when mavenVersionSelection = Path. Maven path. 
    #mavenSetM2Home: false # boolean. Optional. Use when mavenVersionSelection = Path. Set M2_HOME variable. Default: false.
    #mavenOptions: '-Xmx1024m' # string. Alias: mavenOpts. Set MAVEN_OPTS to. Default: -Xmx1024m.
    #mavenAuthenticateFeed: true # boolean. Alias: mavenFeedAuthenticate. Authenticate built-in Maven feeds. Default: true.
  # Code Analysis
    #sonarQubeRunAnalysis: false # boolean. Alias: sqAnalysisEnabled. Run SonarQube or SonarCloud analysis. Default: false.
    #sqMavenPluginVersionChoice: 'latest' # 'latest' | 'pom'. Required when sqAnalysisEnabled = true. SonarQube scanner for Maven version. Default: latest.
    #checkStyleRunAnalysis: false # boolean. Alias: checkstyleAnalysisEnabled. Run Checkstyle. Default: false.
    #pmdRunAnalysis: false # boolean. Alias: pmdAnalysisEnabled. Run PMD. Default: false.
    #findBugsRunAnalysis: false # boolean. Alias: findbugsAnalysisEnabled. Run FindBugs. Default: false.
# Maven v2
# Build with Apache Maven.
- task: Maven@2
  inputs:
    mavenPOMFile: 'pom.xml' # string. Required. Maven POM file. Default: pom.xml.
    #goals: 'package' # string. Goal(s). Default: package.
    #options: # string. Options. 
  # JUnit Test Results
    #publishJUnitResults: true # boolean. Publish to Azure Pipelines/TFS. Default: true.
    testResultsFiles: '**/TEST-*.xml' # string. Required when publishJUnitResults = true. Test results files. Default: **/TEST-*.xml.
    #testRunTitle: # string. Optional. Use when publishJUnitResults = true. Test run title. 
  # Code Coverage
    #codeCoverageToolOption: 'None' # 'None' | 'Cobertura' | 'JaCoCo'. Alias: codeCoverageTool. Code coverage tool. Default: None.
    #codeCoverageClassFilter: # string. Alias: classFilter. Optional. Use when codeCoverageTool != None. Class inclusion/exclusion filters. 
    #codeCoverageClassFilesDirectories: # string. Alias: classFilesDirectories. Optional. Use when codeCoverageTool = JaCoCo. Class files directories. 
    #codeCoverageSourceDirectories: # string. Alias: srcDirectories. Optional. Use when codeCoverageTool = JaCoCo. Source files directories. 
    #codeCoverageFailIfEmpty: false # boolean. Alias: failIfCoverageEmpty. Optional. Use when codeCoverageTool != None. Fail when code coverage results are missing. Default: false.
  # Advanced
    javaHomeOption: 'JDKVersion' # 'JDKVersion' | 'Path'. Alias: javaHomeSelection. Required. Set JAVA_HOME by. Default: JDKVersion.
    #jdkVersionOption: 'default' # 'default' | '1.11' | '1.10' | '1.9' | '1.8' | '1.7' | '1.6'. Alias: jdkVersion. Optional. Use when javaHomeSelection = JDKVersion. JDK version. Default: default.
    #jdkDirectory: # string. Alias: jdkUserInputPath. Required when javaHomeSelection = Path. JDK path. 
    #jdkArchitectureOption: 'x64' # 'x86' | 'x64'. Alias: jdkArchitecture. Optional. Use when jdkVersion != default. JDK architecture. Default: x64.
    mavenVersionOption: 'Default' # 'Default' | 'Path'. Alias: mavenVersionSelection. Required. Maven version. Default: Default.
    #mavenDirectory: # string. Alias: mavenPath. Required when mavenVersionSelection = Path. Maven path. 
    #mavenSetM2Home: false # boolean. Optional. Use when mavenVersionSelection = Path. Set M2_HOME variable. Default: false.
    #mavenOptions: '-Xmx1024m' # string. Alias: mavenOpts. Set MAVEN_OPTS to. Default: -Xmx1024m.
    #mavenAuthenticateFeed: true # boolean. Alias: mavenFeedAuthenticate. Authenticate built-in Maven feeds. Default: true.
  # Code Analysis
    #sonarQubeRunAnalysis: false # boolean. Alias: sqAnalysisEnabled. Run SonarQube or SonarCloud analysis. Default: false.
    #sqMavenPluginVersionChoice: 'latest' # 'latest' | 'pom'. Required when sqAnalysisEnabled = true. SonarQube scanner for Maven version. Default: latest.
    #checkStyleRunAnalysis: false # boolean. Alias: checkstyleAnalysisEnabled. Run Checkstyle. Default: false.
    #pmdRunAnalysis: false # boolean. Alias: pmdAnalysisEnabled. Run PMD. Default: false.
    #findBugsRunAnalysis: false # boolean. Alias: findbugsAnalysisEnabled. Run FindBugs. Default: false.

輸入

mavenPOMFile - Maven POM 檔案
string. 必要。 預設值:pom.xml

指定從存放庫根目錄到 Maven POM 檔案的相對路徑。


goals - 目標 ()
string. 預設值:package


options - 選項
string.


publishJUnitResults - 發佈至 Azure Pipelines
boolean. 預設值:true

指定將 Maven 組建所產生的 JUnit 測試結果發佈至 Azure Pipelines 的選項。 每個測試結果檔案比對 Test Results Files 都會發佈為 Azure Pipelines 中的測試回合。


publishJUnitResults - 發佈至 Azure Pipelines/TFS
boolean. 預設值:true

指定將 Maven 組建所產生的 JUnit 測試結果發佈至 Azure Pipelines/TFS 的選項。 每個測試結果檔案比對 Test Results Files 都會發佈為 Azure Pipelines/TFS 中的測試回合。


testResultsFiles - 測試結果檔案
string. 當 publishJUnitResults = true 時為必要。 預設值:**/TEST-*.xml

指定要發行之測試結果檔案的路徑和模式。 可以使用萬用字元。 檔案 比對模式的詳細資訊。
例如, **/TEST-*.xml 針對名稱開頭 TEST-為 的所有 XML 檔案。
如果未指定任何根路徑,則會在預設工作目錄下比對檔案,而變數 $(System.DefaultWorkingDirectory)中提供的值。 例如,的值 **/TEST-*.xml 實際上會導致 比對 來自的 $(System.DefaultWorkingDirectory)/**/TEST-*.xml檔案。


testRunTitle - 測試回合標題
string. 選擇性。 使用時機 publishJUnitResults = true

指定測試回合的名稱。


allowBrokenSymlinks - 允許中斷的符號連結
輸入別名: allowBrokenSymbolicLinksboolean. 選擇性。 使用時機 publishJUnitResults = true。 預設值:true

當設定為 false時,當工作在發佈測試結果時發現符號連結中斷時,建置會失敗。


codeCoverageToolOption - 程式代碼涵蓋範圍工具
輸入別名: codeCoverageToolstring. 允許值:NoneCoberturaJaCoCo。 預設值:None

指定程式代碼涵蓋範圍工具。


codeCoverageClassFilter - 類別包含/排除篩選
輸入別名: classFilterstring. 選擇性。 使用時機 codeCoverageTool != None

指定要包含或排除類別的逗號分隔篩選清單,以收集程式代碼涵蓋範圍。 例如: +:com.*,+:org.*,-:my.app*.*


codeCoverageClassFilesDirectories - 類別檔案目錄
輸入別名: classFilesDirectoriesstring. 選擇性。 使用時機 codeCoverageTool = JaCoCo

多模組專案需要此欄位。
指定 Maven POM 檔案中相對路徑的逗號分隔清單,到包含類別檔案和封存盤案的目錄, (JAR、WAR 等。) 。 這些目錄中的類別檔案會報告程式代碼涵蓋範圍。 例如: target/classes,target/testClasses


codeCoverageSourceDirectories - 來源檔案目錄
輸入別名: srcDirectoriesstring. 選擇性。 使用時機 codeCoverageTool = JaCoCo

多模組專案需要此欄位。
指定從 Maven POM 檔案到原始程式碼目錄之相對路徑的逗號分隔清單。 程式代碼涵蓋範圍報表會使用這些報表來醒目提示原始程式碼。 例如: src/java,src/Test


codeCoverageFailIfEmpty - 遺失程式代碼涵蓋範圍結果時失敗
輸入別名: failIfCoverageEmptyboolean. 選擇性。 使用時機 codeCoverageTool != None。 預設值:false

如果程式代碼涵蓋範圍未產生任何要發佈的結果,則建置會失敗。


codeCoverageRestoreOriginalPomXml - 在工作執行之後還原原始 pom.xml
輸入別名: restoreOriginalPomXmlboolean. 選擇性。 使用時機 codeCoverageTool != None。 預設值:false

程式代碼涵蓋範圍會 pom.xml 修改以產生結果。 如果您需要保留原始 pom.xml的 ,請使用此選項。


javaHomeOption - 設定JAVA_HOME依據
輸入別名: javaHomeSelectionstring. 必要。 允許的值: JDKVersion (JDK 版本) 。 Path 預設值:JDKVersion

選取將在組建期間探索的 JDK 版本,或手動輸入 JDK 路徑來設定 JAVA_HOME


jdkVersionOption - JDK 版本
輸入別名: jdkVersionstring. 選擇性。 使用時機 javaHomeSelection = JDKVersion。 允許的值:default1.17 (JDK 17) 、 1.11 (JDK 11) 、 1.10 (JDK 10 1.9 () ) 、 (JDK 9 (不支援) ) 、 (JDK 8 1.7) 、 1.8 (JDK 7) 、 1.6 (JDK 6 (不支援) ) 。 預設值:default

嘗試探索所選 JDK 版本的路徑,並據以設定 JAVA_HOME


jdkVersionOption - JDK 版本
輸入別名: jdkVersionstring. 選擇性。 使用時機 javaHomeSelection = JDKVersion。 允許的值: default、 (1.11 JDK 11) 、 1.10 (JDK 10 (不支援) ) 、 1.9 (JDK 9 (不支援) ) 、 1.8 (JDK 8) 1.7 、 (JDK 7) 、 1.6 (JDK 6 () ) 。 預設值:default

嘗試探索所選 JDK 版本的路徑,並據以設定 JAVA_HOME


jdkDirectory - JDK 路徑
輸入別名: jdkUserInputPathstring. 當 javaHomeSelection = Path 時為必要。

將設定 JAVA_HOME 為指定的路徑。


jdkArchitectureOption - JDK 架構
輸入別名: jdkArchitecturestring. 選擇性。 使用 時 jdkVersion != default。 允許值:x86x64。 預設值:x64

提供 JDK 的架構 (x86x64) 。


mavenVersionOption - Maven 版本
輸入別名: mavenVersionSelectionstring. 必要。 允許的值: DefaultPath (自定義路徑) 。 預設值:Default

使用預設 Maven 版本或指定自定義路徑中的版本。


mavenDirectory - Maven 路徑
輸入別名: mavenPathstring. 當 mavenVersionSelection = Path 時為必要。

指定 Maven 安裝 (的自定義路徑,例如: /usr/share/maven) 。


mavenSetM2Home - 設定M2_HOME變數
boolean. 選擇性。 使用 時 mavenVersionSelection = Path。 預設值:false

M2_HOME 變數設定為自定義 Maven 安裝路徑。


mavenOptions - 將 MAVEN_OPTS 設定為
輸入別名: mavenOptsstring. 預設值:-Xmx1024m

MAVEN_OPTS設定環境變數,用來傳送命令行自變數來啟動 JVM。 旗 -Xmx 標會指定 JVM 可用的記憶體上限。


mavenAuthenticateFeed - 使用成品摘要進行驗證
輸入別名: mavenFeedAuthenticateboolean. 預設值:true

使用 Azure Artifacts 摘要自動進行驗證。 如果成品摘要未使用中,請取消選取此選項以取得更快速的組建。


mavenAuthenticateFeed - 驗證內建 Maven 摘要
輸入別名: mavenFeedAuthenticateboolean. 預設值:true

使用 Azure Artifacts 摘要自動進行驗證。 如果成品摘要未使用中,請取消選取此選項以取得更快速的組建。


sonarQubeRunAnalysis - 執行 SonarQube 或 SonarCloud 分析
輸入別名: sqAnalysisEnabledboolean. 預設值:false

此選項已從使用 Maven 工作第 1 版變更為使用 SonarQubeSonarCloud Marketplace 擴充功能。
啟用此選項以在 [Goals] 字段中執行目標之後,執行 SonarQube 或 SonarCloud 分析安裝套件目標應該先執行。 在此 Maven 工作之前,您也必須從其中一個延伸模組將 準備分析組態 工作新增至組建管線。


isJacocoCoverageReportXML - 使用 XML Jacoco 報告進行 SonarQube 分析
boolean. 選擇性。 使用 時 sqAnalysisEnabled = true && codeCoverageTool = JaCoCo。 預設值:false

使用 XML Jacoco 報告進行 SonarQube 分析。 深入瞭解 測試報告


sqMavenPluginVersionChoice - 適用於 Maven 版本的 SonarQube 掃描器
string. 當 sqAnalysisEnabled = true 時為必要。 允許的值: latest (使用最新版本) , pom (使用在 pom.xml) 中宣告的版本。 預設值:latest

指定要使用的 SonarQube Maven 外掛程式版本。 您可以使用最新版本,或依賴 中的 pom.xml版本。


checkStyleRunAnalysis - 執行 Checkstyle
輸入別名: checkstyleAnalysisEnabledboolean. 預設值:false

使用預設的 Sun 檢查執行 Checkstyle 工具。 結果會上傳為組建成品。


pmdRunAnalysis - 執行 PMD
輸入別名: pmdAnalysisEnabledboolean. 預設值:false

使用 PMD 靜態分析工具來尋找程式代碼中的 Bug。 結果會上傳為組建成品。


findBugsRunAnalysis - 執行 FindBugs
輸入別名: findbugsAnalysisEnabledboolean. 預設值:false

使用 FindBugs 靜態分析工具來尋找程式代碼中的 Bug。 結果會上傳為組建成品。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制選項和一般工作屬性

輸出變數

無。

備註

SonarQube 分析的設定已移至工作準備分析組態中的 SonarQubeSonarCloud 延伸模組。

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
在上執行 Agent、DeploymentGroup
要求 自我裝載代理程式必須具備符合下列需求的功能,才能執行使用此工作的作業:maven
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任何
可設定變數 任何
代理程式版本 1.89.0 或更新版本
工作類別 建置

另請參閱