gpt4 book ai didi

java - 从 Maven Artifactory 中提取所有 Artifact ,而不仅仅是 JAR Artifact

转载 作者:行者123 更新时间:2023-12-02 01:10:59 25 4
gpt4 key购买 nike

我已经将一个库发布到了artifactory,具有以下 Artifact 和结构:

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

当我从 Artifact 中提取时,我只在 m2 文件夹中看到这些 jar Artifact :

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

我没有看到 .bin Artifact 被拉入

这是我的 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 中修改什么才能从 Artifact 中提取所有 Artifact ?

最佳答案

没有 <type> 的依赖项有<type>jar</type>隐含地。要下载其他 Artifact ,您需要添加类似 <type>bin</type> 的条目到你的依赖,比如

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

关于java - 从 Maven Artifactory 中提取所有 Artifact ,而不仅仅是 JAR Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59415868/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com