使用 Jenkins 将二进制文件与 JAR 文件一起发布到 maven 工件工厂



我正在尝试使用 Jenkins 将 Java 库发布到 artifactory。目前,它仅将.jar文件发布到artifactory。我有一个二进制文件 (.bin(,我想与.jar文件一起发布。有谁知道我需要在我的 POM 文件中插入什么才能完成这项工作?

例如,我希望工件中的文件结构如下所示:

test-0.1.jar
test.bin
...

这是我的POM文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.test</groupId>
<artifactId>test</artifactId>
<version>0.1</version>
<name>Test Lib </name>
<packaging>jar</packaging>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- Avoid Java 8's strict doc generator-->
<profiles>
<profile>
<id>disable-java8-doclint</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<source>8</source>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

构建帮助程序 maven 插件允许您附加其他工件,请参阅

https://www.mojohaus.org/build-helper-maven-plugin/usage.html

在"将其他项目附加到项目"下,或

https://www.mojohaus.org/build-helper-maven-plugin/attach-artifact-mojo.html

相关内容

最新更新