简体   繁体   中英

how to configure local and remote repository in settings.xml for maven

I have my own organization internal repository for which i would like to use:

    <repository>
        <id>archiva.default</id>
        <url>http://my.org.repo:8000/archiva/repository/internal/</url>
    </repository>

I also needed remote repository to get latest version of maven-resource-plugin, maven-compile-plugin, jboss etc.

Can someone please suggest me how to configure settings.xml so that maven downloads the dependencies that are available in internal repository, if the dependencies are not available in internal repository then get it from remote repository.

found the solution http://archiva.apache.org/docs/1.0.2/userguide/using-repository.html :

<profiles>
<profile>
  <id>Repository Proxy</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
  <!-- ******************************************************* -->
  <!-- repositories for jar artifacts -->
  <!-- ******************************************************* -->
  <repositories>
    <repository>
      ...
    </repository>
    ...   
  </repositories>
  <!-- ******************************************************* -->
  <!-- repositories for maven plugins -->
  <!-- ******************************************************* -->
  <pluginRepositories>
    <pluginRepository>
      ...
    </pluginRepository>
    ...   
  </pluginRepositories>
</profile>
...

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