Reputation: 747
I am attempting to configure the following workflow pattern in Jenkins:
I seem to be missing something. The components of the application (jar files, etc.) appear to get deployed to Artifactory just fine in the target releases/snapshots directories. However, the final WAR artifact doesn't seem to get stored in Artifactory despite Jenkins clearly identifying the artifact was successfully built.
I'm using the standard targets: clean install. I have also attempted (with no change): clean install repackage
I have the standard Artifactory plugin for Jenkins installed.
I have checked the following configurations for the first Jenkins Job to build the project and publish it to Artifactory:
PRE-BUILD & BUILD
POST-BUILD
An editable email notification post-build step is also included.
I can use these same options and they will successfully deploy the final WAR file to a Tomcat instance without issue. Jenkins also holds on to the WAR file based on configuration. But Artifactory seems to store the components instead of the final WAR file.
I've been playing with config options and coming up blank for too long. Any and all help is appreciated.
EDIT: Here is a snippit from the POM file used for the "clean install" target when building the war file.
<build>
<defaultGoal>clean install</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<includes>
<include>**/*Tests.java</include>
<include>**/*Test.java</include>
<include>**/Test*.java</include>
</includes>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
<manifestEntries>
<Implementation-Version>${project.version}</Implementation-Version>
<Implementation-Revision>${git.revision}</Implementation-Revision>
<X-Git-Commits-Count>${git.commitsCount}</X-Git-Commits-Count>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</build>
Upvotes: 4
Views: 7597
Reputation: 10382
It seems that the War file is the second artefact of your Maven project.
Can you have a look here and tell us if it solves your issue? Maven deploy secondary file to repository
Upvotes: 1