<project> <distributionManagement> <repository> <id>releases</id> <url>http://192.168.1.99:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>snapshots</id> <url>http://192.168.1.99:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement> </project>
<settings> <servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> </servers> </settings>
注意pom文件中distributionManagement 中的id要和 settings文件中 servers 的id要保持一致html
最後執行 mvn deploy
就能夠將項目上傳到私服上了java