配置maven从nexus下载构建
在setting.xml中配置
<profile>
<id>dev</id> <properties> <RUNTIME_ENV>dev</RUNTIME_ENV> </properties> <repositories> <repository> <id>nexus</id> <name>nexus</name> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> <url>http://*.*.*.*:8085/nexus/content/groups/public/</url> </repository> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>nexus</name> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> <url>http:///*.*.*.*:8085/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </repositories> </profile><profile> <id>product</id> <properties> <RUNTIME_ENV>product</RUNTIME_ENV> </properties> <repositories> <repository> <id>nexus</id> <name>nexus</name> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> <url>http:///*.*.*.*:8085/nexus/content/groups/public/</url> </repository> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>nexus</name> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> <url>http:///*.*.*.*:8085/nexus/content/groups/public/</url> </pluginRepository> </pluginRepositories> </repositories> </profile><activeProfiles>
<activeProfile>dev</activeProfile> </activeProfiles>部署构建至nexus
在setting.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> <name>Nexus Release Repository</name> <url>http://*.*.*.*:8085/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://*.*.*.*:8085/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>