Azure DevOps Maven 任务配置文件

And*_*006 6 java continuous-integration maven azure-devops

我在 Azure DevOps Pipelines 中使用 Maven 任务。我需要激活具体的配置文件,但我不明白该怎么做。我尝试在“选项”和“目标”中传递配置文件,但它不起作用。如何正确激活配置文件?

- task: Maven@3
  displayName: maven_project_profile
  inputs:
    mavenPomFile: 'my_project/pom.xml'
    options: '-DskipTests=true -P someprofile'
    goals: 'clean deploy -p someprofile'
    publishJUnitResults: true
    testResultsFiles: '**/surefire-reports/TEST-*.xml'
    testRunTitle: 'fixBypassService'
    javaHomeOption: 'JDKVersion'
    jdkVersionOption: '1.8'
    mavenVersionOption: 'Default'
    mavenAuthenticateFeed: false
    effectivePomSkip: false
    sonarQubeRunAnalysis: false
Run Code Online (Sandbox Code Playgroud)

我可以在日志中看到:

2020-01-13T08:45:13.1695224Z [command]/usr/share/apache-maven-3.6.2/bin/mvn -f /home/vsts/work/1/s/my_project/pom.xml -DskipTests=true -P someprofile clean deploy -P someprofile
Run Code Online (Sandbox Code Playgroud)

但配置文件“someprofile”实际上并未激活。

And*_*006 7

我错了。如果您在目标中传递配置文件,则它会被正确激活:

- task: Maven@3
  displayName: maven_project_profile
  inputs:
    mavenPomFile: 'my_project/pom.xml'
    goals: 'clean deploy -P someprofile'
Run Code Online (Sandbox Code Playgroud)

我看不到激活的结果,因为访问代理内的某些资源存在问题,但这对于当前的帖子来说无关紧要。一切正常。

编辑:国旗是大写的P