1.下载包 在<project>标签中
<repositories> <repository> <id>nexus</id> <url>http://10.39.93.105:8081/repository/maven-public/</url> <releases><enabled>true</enabled></releases> <snapshots><enabled>true</enabled></snapshots> </repository> </repositories>
2.发布标签 ,在<project>标签中,使用maven 的deploy 命令发布 , <id>nexus</id> 要与 settings.xml里 server里配置的id一致。
<distributionManagement> <repository> <id>nexus</id> <name>Nexus Release Repository</name> <url>http://10.39.93.105:8081/repository/maven-releases/</url> </repository> <snapshotRepository> <id>nexus</id> <name>Nexus Snapshot Repository</name> <url>http://10.39.93.105:8081/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
settings.xml配置
<servers> <server> <id>nexus</id> <username>admin</username> <password>admin123</password> </server> <server> <id>3rd</id> <username>admin</username> <password>admin123</password> </server>
</servers>