【问题标题】:Azure Maven task output missing缺少 Azure Maven 任务输出
【发布时间】:2021-08-22 21:42:02
【问题描述】:

我使用 Maven 任务创建了一个 Azure 管道来构建一组 Web 应用程序。已创建工件提要,并将所需的 [repository] ​​和 [distributionManagement] 部分添加到根 pom 文件中,如下所示:

<repositories>
    <repository>
        <id>ion-wildfly-pipeline-feed</id>
        <url>https://pkgs.dev.azure.com/MYFEEDNAME</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<distributionManagement>
    <repository>
        <id>ion-wildfly-pipeline-feed</id>
        <url>https://pkgs.dev.azure.com/MYFEEDNAME</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</distributionManagement>

管道作业完成且没有错误。在工件提要中,我可以看到在构建过程中下载了很多依赖项,但生成的 .war 文件不存在。

知道我错过了什么吗? Maven build 命令的结果在哪里结束?不应该是指定的工件提要吗?

编辑以添加管道 yaml:

触发器:

  • 主人

池: vmImage:ubuntu 最新版

步骤:

  • 任务:Maven@3 输入: mavenPomFile: 'pom.xml'

    mavenOptions: '-Xmx3072m -DartifactId=ion-wildfly-pipeline-feed'

    javaHomeOption: 'JDKVersion'

    jdkVersionOption: '1.8'

    jdkArchitectureOption: 'x64'

    publishJUnitResults: true

    testResultsFiles: '**/surefire-reports/TEST-*.xml'

    目标:“包裹”

    mavenAuthenticateFeed: true

【问题讨论】:

  • Azure 管道的 YAML 是什么样的?
  • 我将它添加到原始帖子中。这里不适合。这是相当标准的,虽然我确实发现我必须添加 mavenAuthenticateFeed: true

标签: azure maven azure-pipelines artifacts


【解决方案1】:

如果你想生成war文件,我认为你应该将你的项目定义为war类型的包装,并在编译时添加maven插件来生成war:

.....
<packaging>war</packaging>

....

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
        <attachClasses>true</attachClasses>
        <webXml>xxx/web.xml</webXml>
        <webResources>
            <resource>
                <directory>xxx/xxx</directory>
                <filtering>true</filtering>
            </resource>
        </webResources>
    </configuration>
</plugin>

...

【讨论】:

  • 我有。当我从命令行运行 maven 时,war 文件创建得很好。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多