简体   繁体   中英

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. 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. 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:

<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. It also looks like maven repo is automatically tried whether you list it or not in pom.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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