詹金斯(Jenkins)的“后期制作行动"在Maven存储库上部署zip [英] Jenkins "Post Build Action" to deploy zip on Maven repository
问题描述
我最近开始使用Jenkins,目前正在使用1.492版本.我有一个Maven模块项目,该项目会生成一个Jar和一个Zip文件,我希望将它们部署到Nexus Maven存储库. 当我在本地构建项目时,会收到以下消息: 将PROJECT_DIR/target/groupID/projectId-version.jar安装到LOCAL_REPO/groupID/projectId-version.jar 将PROJECT_DIR/groupID/projectId.zip安装到LOCAL_REPO/groupID/projectId/version/projectId-version-classifier.zip
I Have recently started using Jenkins and currently using version 1.492. I have a Maven module project which produces a Jar and a Zip files which I want to deploy to a Nexus Maven repository. When I build my project locally I get the message : Installing PROJECT_DIR/target/groupID/projectId-version.jar to LOCAL_REPO/ groupID/projectId-version.jar Installing PROJECT_DIR /groupID/projectId.zip to LOCAL_REPO/ groupID/projectId/version/ projectId-version-classifier.zip
使用构建后操作"将工件部署到Maven存储库.在Jenkins生成日志上,我可以看到我的jar已部署,但关于zip却一无所获. 有特定的配置可以解决吗?
Using the "Post Build Action" Deploy artifacts to Maven repository. On the Jenkins build logs I can see my jar is deployed but nothing about my zip. Is there a specific config to fix it?
推荐答案
配置您的项目以附加其他zip工件.
Configure your project to attach additional zip artifact.
<project>
...
<build>
<plugins>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>some file</file>
<type>extension of your file </type>
<classifier>optional</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
这篇关于詹金斯(Jenkins)的“后期制作行动"在Maven存储库上部署zip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!