xml文件project標籤下加入:url
<distributionManagement> <repository> <id>nexus-releases</id> <name>nexus release repo</name> <url>http://localhost:9001/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>nexus snapshot repo</name> <url>http://localhost:9001/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>
.../conf/setting.xml:code
<servers> <server> <!-- 對應pom中的id --> <id>nexus-snapshots</id> <username>admin</username> <password>admin123,默認密碼</password> <!--<privateKey>nexus-snapshots</privateKey>--> <!--<passphrase>admin123</passphrase>--> </server> <server> <id>nexus-releases</id> <username>admin</username> <password>admin123</password> </server> </servers>
mvn clean deployserver