简体   繁体   English

Maven 项目仅从内部工件(pom.xml)下载

[英]Maven project only downloading from internal artifactory (pom.xml)

I have a local Java intelli-J project with a pom.xml that has (2) internal repositories on artifactory.我有一个本地 Java intelli-J 项目,它有一个 pom.xml,它在工件上有 (2) 个内部存储库。 The problem is I am doing some testing, and I think one of the JARs is not on this internal repo, so I want to use the regular Maven central repo.问题是我正在做一些测试,我认为 JARs 之一不在这个内部仓库中,所以我想使用常规的 Maven 中央仓库。 I googled and believe, the artifact should go through the list in your pom.xml is the order its listed and try to resolve the artifact, the problem is, even when I add the Maven central repo, it seems to never attempt; I googled and believe, the artifact should go through the list in your pom.xml is the order its listed and try to resolve the artifact, the problem is, even when I add the Maven central repo, it seems to never attempt; only tries the internal artifactory then fails.只尝试内部工件然后失败。

In my pom.xml:在我的 pom.xml 中:

<repositories>
        <repository>
            <id>test</id>
            <name>Maven Central</name>
            <layout>default</layout>
            <url>https://repo1.maven.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>my_repo</id>
            <name>MyRepo</name>
            <url>https://myinternalrepo.com</url>
        </repository>
        <repository>
            <snapshots />
            <id>MySnapShotRepo</id>
            <name>MyInternalRepo</name>
            <url>https://myinternalreposnapshots.com</url>
        </repository>
    </repositories>

am I doing something wrong here?我在这里做错了吗?

I removed my settings.xml and was able to control the repositories from the pom.xml file tag.我删除了我的 settings.xml 并能够从 pom.xml 文件标签控制存储库。 It also looks like maven repo is automatically tried whether you list it or not in pom.它看起来也像 maven repo 会自动尝试无论你是否在 pom 中列出它。

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

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