maven - 如何设置 pom.xml 从 Nexus 远程存储库下载 Artifact

标签 maven pom.xml nexus

我想在maven中设置一个远程nexus存储库与我的本地存储库,当本地存储库中没有 Artifact 时,应该从我的远程存储库下载它并安装到本地存储库。如何设置?

最佳答案

您必须将存储库部分添加到您的 pom 中。

这是一个例子:

<repositories>
    <repository>
        <id>browserid-snapshots</id>
        <name>browserid-snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
</repositories>

取自这里https://github.com/user454322/browserid-verifier/blob/e7b81495882312c8cd9f1fb7e8313e239a6b3238/sample/pom.xml#L67-L73


检查 POM Reference 上的存储库部分了解更多信息。

关于maven - 如何设置 pom.xml 从 Nexus 远程存储库下载 Artifact ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25479537/

相关文章:

java - Maven 使用 Spring 构建和依赖注入(inject)

mysql - hibernate 、JPA、MySQL : Unable to build EntityManagerFactory

java - 遵循 Jersey 2.0 用户指南时出现 Unresolved 依赖项错误

maven - Nexus 发布暂存存储库解决方案

maven - 如何强制 sonatype nexus 3 为 maven 存储库重新创建 maven-metadata.xml?

Android Studio Gradle 错误 : 'android-maven' not found

maven-2 - OSGI:在maven-bundle-plugin中生成bundle-classpath

java - 无法启动quarkus : Failed to load steps from class io. quarkus.deployment.logging.LoggingResourceProcessor

repository - 无法在 Windows 2012 上运行 Sonatype Nexus Repository Manager 3.0

java - 如何保持所有版本的RESTful接口(interface)在线?