[英]Using Jenkins and maven to publish a WAR file to Artifactory
I am attempting to configure the following workflow pattern in Jenkins: 我试图在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. 应用程序的组件(jar文件等)似乎在目标版本/快照目录中很好地部署到Artifactory。 However, the final WAR artifact doesn't seem to get stored in Artifactory despite Jenkins clearly identifying the artifact was successfully built. 但是,尽管Jenkins清楚地识别出工件已成功构建,但最终的WAR工件似乎并未存储在Artifactory中。
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. 我安装了Jenkins的标准Artifactory插件。
I have checked the following configurations for the first Jenkins Job to build the project and publish it to Artifactory: 我已经检查了第一个Jenkins作业的以下配置来构建项目并将其发布到Artifactory:
PRE-BUILD & BUILD 预建和建设
POST-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. 我可以使用这些相同的选项,他们将成功地将最终的WAR文件部署到Tomcat实例而不会出现问题。 Jenkins also holds on to the WAR file based on configuration. Jenkins还根据配置保留了WAR文件。 But Artifactory seems to store the components instead of the final WAR file. 但Artifactory似乎存储组件而不是最终的WAR文件。
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. 编辑:这是构建war文件时用于“干净安装”目标的POM文件的snippit。
<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>
It seems that the War file is the second artefact of your Maven project. 似乎War文件是Maven项目的第二个人工制品。
Can you have a look here and tell us if it solves your issue? 你能看一看并告诉我们它是否能解决你的问题吗? Maven deploy secondary file to repository Maven将辅助文件部署到存储库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.