Jenkins “Post Build Action” to deploy zip on Maven repository

余生颓废 提交于 2019-12-12 00:39:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!