Tag:javamaven
Article From:https://segmentfault.com/q/1010000012140356
Question:

He built a nexus warehouse, hoping that Maven only points to the Nexus warehouse, but now only the ordinary warehouse points to the nexus, while the download Plug-in points to the default plug-in warehouse (this address: https://repo.maven.apacHe.org…) how to set up the Maven setting file?

At present, mirror and profile in setting are set up as follows

    <mirror>
        <id>maven-public</id>
        <name>nexus</name>
        <url>http://xxx:8081/repository/maven-public/</url>
        <mirrorOf>public</mirrorOf>
    </mirror>

   <profile>
         <id>Nexus152</id>
         <activation>
             <jdk>1.8</jdk>
         </activation>
         <repositories>
            <repository>
                <id>public</id>
                <url>http://xxx:8081/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
             </repository>
         </repositories>

         <pluginRepositories>
             <pluginRepository>
                    <id>central</id>
                    <url>http://xxx:8081/repository/maven-central/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
             </pluginRepository>
         </pluginRepositories>
    </profile>

At the same time, adding pluginRepositories to the POM file can point to nexus.

Ask the God to help!

Answer 0:

Change URL into a local warehouse Path

Leave a Reply

Your email address will not be published. Required fields are marked *