Available domestic maven repository configuration

As some reason, when the download maven dependencies from a central repository, by various torture, following a brief look at some simple configuration of the Setting.xml maven


First posted several domestic maven repository available connections:

http://maven.oschina.net/content/groups/public/

http://maven.oschina.net/content/repositories/thirdparty/

http://maven.ibiblio.org/maven2/

http://repository.jboss.org/nexus/content/repositories/root_repository/maven2/

http://repo1.maven.org/maven2/

http://repository.sonatype.org/content/groups/public/

http://repository.jboss.com/maven2/


About setting.xml configuration:

1, the local repository configuration

<localRepository>E:\.m2\Repository</localRepository>

2, Acting warehouse, mirror configurations:

  <mirrors>
    <mirror>
        <id>nexus-osc</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus osc</name>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>
    <mirror>
        <id>nexus-osc-thirdparty</id>
        <mirrorOf>thirdparty</mirrorOf>
        <name>Nexus osc thirdparty</name>
        <url>http://maven.oschina.net/content/repositories/thirdparty/</url>
    </mirror>
        <mirror>
        <id>nexus-ibiblio</id>
        <mirrorOf>*</mirrorOf>
        <name>Nexus ibiblio</name>
        <url>http://maven.ibiblio.org/maven2/</url>
    </mirror>
  </mirrors>


3, maven plugin download configuration repository

  <profiles>
    <profile>
        <id>jdk-1.4</id>
        
        <activation>
            <jdk>1.4</jdk>
        </activation>
        
        <repositories>
            <repository>
                <id>nexus</id>
                <name>local private nexus</name>
                <url>http://maven.oschina.net/content/groups/public/</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        
        <pluginRepositories>
            <pluginRepository>
            <id>nexus</id>
            <name>local private nexus</name>
            <url>http://maven.oschina.net/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>



Here is my own configuration setting.xml

<mirrors>
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->
<mirror>
<id>org-repo1</id>
<mirrorOf>*</mirrorOf>
<name>org repo1</name>
<url>http://repo1.maven.org/maven2/</url>
</mirror>

<mirror>
<id>com-jboss</id>
<mirrorOf>*</mirrorOf>
<name>com jboss</name>
<url>http://repository.jboss.com/maven2/</url>
</mirror>

<mirror>
<id>org-sonatype</id>
<mirrorOf>*</mirrorOf>
<name>org sonatype</name>
<url>http://repository.sonatype.org/content/groups/public/</url>
</mirror>
  </mirrors>



If the download is relatively slow, then you can manually download and then deploy to a local repository, download address: http: //repo1.maven.org/maven2/ although not fast but still relatively wide.



Guess you like

Origin blog.csdn.net/shui878412/article/details/53195026