0
votes

I have created an Azure pipeline using a Maven task to build a set of web apps. An artifact feed has been created and the needed [repository] and [distributionManagement] sections have been added to the root pom file as shown here:

<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>

The pipeline job completes with no errors. In the artifacts feed I can see a lot of dependencies that were downloaded during the build, but the resulting .war files are not there.

Any idea what I am missing? Where do the results of the Maven build command end up? Shouldn't it be the specified artifact feed?

Edit to add pipeline yaml:

trigger:

  • master

pool: vmImage: ubuntu-latest

steps:

  • task: Maven@3 inputs: mavenPomFile: 'pom.xml'

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

    javaHomeOption: 'JDKVersion'

    jdkVersionOption: '1.8'

    jdkArchitectureOption: 'x64'

    publishJUnitResults: true

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

    goals: 'package'

    mavenAuthenticateFeed: true

1
What does the YAML for your Azure Pipeline look like?Jeremy Caney
I added it to the origianl post. It wouldn't fit here. It's pretty standard, though I did find I had to add mavenAuthenticateFeed: trueTed Hale

1 Answers

0
votes

If you want to generate the war file, you should I think you have to define your project with as packaging of war type and also add maven plugin to generate the war when compiling:

.....
<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>

...