问题
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
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?
回答1:
See this link link to interesting post it'll help you. Using maven-assembly-plugin is the way to go.
回答2:
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>
来源:https://stackoverflow.com/questions/15434439/jenkins-post-build-action-to-deploy-zip-on-maven-repository