mvn: 将依赖项分配到存储库

huangapple go评论38阅读模式
英文:

mvn: assign depenendecy to repository

问题

需要将此存储库添加到才能下载此依赖项:

<repositories>
    <repository>
    <id>confluent</id>
    <url>https://packages.confluent.io/maven/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-streams-avro-serde</artifactId>
        <version>${kafka.streams.avro-serde.version}</version>
    </dependency>
</dependencies>

但是,mvn 正试图使用此存储库下载所有其他依赖项。如何设置只有上面的依赖项使用上面的 confluent 存储库?

英文:

I need to add this repository in order to be able to download this dependency:

<repositories>
    <repository>
    <id>confluent</id>
    <url>https://packages.confluent.io/maven/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-streams-avro-serde</artifactId>
        <version>${kafka.streams.avro-serde.version}</version>
    </dependency>
</dependencies>

However, mvn is trying to download all other dependencies using this repository.

How could I set that only above dependency uses above confluent repository?

答案1

得分: 1

你不能将依赖关联到存储库。

但通常这不是问题,因为Maven将浏览所有存储库以查找你的依赖项,所以最终会找到它们。

如果有一个存储库非常慢(并减慢下载速度),尝试将其放在最后。

英文:

You cannot relate dependencies to repositories.

But this is usually no problem because Maven will go through all repositories to find your dependencies, so it will eventually find them.

If one is very slow (and slows down the downloads), try to place it at the end.

huangapple
  • 本文由 发表于 2023年3月3日 18:40:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/75626014.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定