繁体   English   中英

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

[英]Publish binary file to maven artifactory along with JAR files using Jenkins

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM