1 pom.xml配置

  1. <properties>
  2. <!--仓库地址 -->
  3. <repository.url>http://10.3.3.12:8081/repository/maven-public/</repository.url>
  4. <releases.url>http://10.3.3.12:8081/repository/maven-releases/</releases.url>
  5. <snapshot.url>http://10.3.3.12:8081/repository/maven-snapshots/</snapshot.url>
  6. </properties>
  7. <distributionManagement>
  8. <repository>
  9. <id>ncamcmaven-releases</id>
  10. <name>releases</name>
  11. <url>${releases.url}</url>
  12. </repository>
  13. <snapshotRepository>
  14. <id>ncamcmaven-snapshots</id>
  15. <name>snapshots</name>
  16. <url>${snapshot.url}</url>
  17. </snapshotRepository>
  18. </distributionManagement>
  19. <repositories>
  20. <repository>
  21. <id>maven private</id>
  22. <name>internal repository for private</name>
  23. <url>${repository.url}</url>
  24. <releases>
  25. <enabled>true</enabled>
  26. </releases>
  27. <snapshots>
  28. <enabled>false</enabled>
  29. </snapshots>
  30. </repository>
  31. </repositories>
  32. <pluginRepositories>
  33. <pluginRepository>
  34. <id>nexus</id>
  35. <name>local private nexus</name>
  36. <url>${repository.url}</url>
  37. <releases>
  38. <enabled>true</enabled>
  39. </releases>
  40. <snapshots>
  41. <enabled>false</enabled>
  42. </snapshots>
  43. </pluginRepository>
  44. </pluginRepositories>

2 settings.xml配置

  1. <servers>
  2. <server>
  3. <id>ncamcmaven-public</id>
  4. <username>admin</username>
  5. <password>admin123</password>
  6. </server>
  7. <server>
  8. <id>ncamcmaven-snapshots</id>
  9. <username>admin</username>
  10. <password>admin123</password>
  11. </server>
  12. <server>
  13. <id>ncamcmaven-releases</id>
  14. <username>admin</username>
  15. <password>admin123</password>
  16. </server>
  17. </servers>
  18. <mirrors>
  19. <mirror>
  20. <id>ncamcmaven-public</id>
  21. <name>ncamcmaven</name>
  22. <mirrorOf>*</mirrorOf>
  23. <url>http://10.3.3.12:8081/repository/maven-public/</url>
  24. </mirror>
  25. <mirror>
  26. <id>ncamcmaven-snapshots</id>
  27. <name>ncamcmaven</name>
  28. <mirrorOf>*</mirrorOf>
  29. <url>http://10.3.3.12:8081/repository/maven-releases/</url>
  30. </mirror>
  31. <mirror>
  32. <id>ncamcmaven-releases</id>
  33. <name>ncamcmaven</name>
  34. <mirrorOf>*</mirrorOf>
  35. <url>http://10.3.3.12:8081/repository/maven-snapshots/</url>
  36. </mirror>
  37. <!-- 阿里的配置 -->
  38. <mirror>
  39. <id>alimaven</id>
  40. <name>alimaven</name>
  41. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  42. <mirrorOf>central</mirrorOf>
  43. </mirror>
  44. </mirrors>