添加到settings.xml中 <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> 添加到pom.xml中 <distributionManagement> <repository> <id>releases</id> <url>http://localhost:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://localhost:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> --------------------------------------------------- 添加到settings.xml中 <profile> <!--profile的id--> <id>dev</id> <repositories> <repository> <!--倉庫id,,repositories可以配置多個(gè)倉庫,,保證id不重復(fù)--> <id>nexus</id> <!--倉庫地址,,即nexus倉庫組的地址--> <url>http://localhost:8081/nexus/content/groups/public/</url> <!--是否下載releases構(gòu)件--> <releases> <enabled>true</enabled> </releases> <!--是否下載snapshots構(gòu)件--> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!-- 插件倉庫,,maven的運(yùn)行依賴插件,,也需要從私服下載插件 --> <pluginRepository> <!-- 插件倉庫的id不允許重復(fù),,如果重復(fù)后邊配置會(huì)覆蓋前邊 --> <id>public</id> <name>Public Repositories</name> <url>http://localhost:8081/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </profile> <activeProfiles> <activeProfile>dev</activeProfile> </activeProfiles> ---------------------------------------------------------------------- <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror> |
|