簡體   English   中英

從 Maven Artifactory 中提取所有工件,而不僅僅是 JAR 工件

[英]Pull all artifacts from Maven Artifactory instead of just JAR artifacts

我已經發布了一個帶有以下工件和結構的 artifactory 庫:

test-1.3-20191219-1-jar-with-dependencies.jar
test-1.3-20191219-1-jar-with-dependencies.jar.md5
test-1.3-20191219-1-jar-with-dependencies.jar.sha1
test-1.3-20191219-1-javadoc.jar
test-1.3-20191219-1-javadoc.jar.md5
test-1.3-20191219-1-javadoc.jar.sha1
test-1.3-20191219-1.bin
test-1.3-20191219-1.bin.md5
test-1.3-20191219-1.bin.sha1

當我從 artifactory 中提取時,我只能在 m2 文件夾中看到這些 jar 工件:

_remote.repositories
test-1.3.jar
test-1.3.jar.sha1

我沒有看到.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.client</artifactId>
    <version>1.3</version>

    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <jdk.version>1.7</jdk.version>

        <log4j.version>1.7.12</log4j.version>

        <junit.version>4.11</junit.version>

        <es.version>2.3.2</es.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <inherited>true</inherited>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>com.github.test</groupId>
            <artifactId>test</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.bytedeco</groupId>
            <artifactId>javacpp</artifactId>
            <version>1.3.1</version>
        </dependency>
    </dependencies>
       <repositories>
        <repository>
        <id>my-test-repository</id>
        <name>my-test</name>
        <url>artifactory-url</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    </repositories>
</project>

我需要在 POM 中修改什么才能從 artifactory 中提取所有工件?

沒有<type>依賴項隱式具有<type>jar</type> 要下載其他工件,您需要將諸如<type>bin</type>條目添加到您的依賴項中,例如

<dependency>
    <groupId>com.github.test</groupId>
    <artifactId>test</artifactId>
    <version>1.3</version>
    <type>bin</type>
</dependency>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM