简体   繁体   中英

Maven get from Wrong repository

I have problem with Maven. I can't download files from my Server Nexus installation. It always try to download from " https://repo.maven.apache.org/maven2 " but this repository does not appear in my settings.xml If i run Maven with "mvn -x" i can see that Maven read the Settings.xml from the correct place. I can't see where is my error¡

Here is my Settings.xml:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>C:\Users\user74679\.m2\repository</localRepository>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers>
    <server>
        <id>NexusRepo</id>
        <username>USER</username>
        <password>PASSWORD</password>
        <filePermissions>664</filePermissions>
        <directoryPermissions>775</directoryPermissions>
        <configuration/>
    </server>
</servers>

<mirrors>
    <mirror>
        <id>maven.org</id>
        <name>Maven Repo1</name>
        <url>https://repo1.maven.org/maven2/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
</mirrors>
<proxies/>
<profiles>
    <profile>
        <id>artifactory</id>
        <repositories>
            <repository>
                <id>NexusRepo</id>
                <name>libs-releases</name>
                <url>https://10.0.0.8/nexus/content/repositories/Release</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>MavenRepo</id>
                <name>libs-releases</name>
                <url>https://repo1.maven.org/maven2/</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>               
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>central</id>
                <name>plugins-releases</name>
                <url>https://10.0.0.8/nexus/content/repositories/Release/</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>
<activeProfiles>
    <activeProfile>artifactory</activeProfile>
</activeProfiles>

It could be that the repository is defined in your pom, or some parent pom. If you want to avoid that, define a repository group in your own Nexus, add all relevant repositories to it and then mirror everything by that group (ie by using a * in the mirrorof settings).

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