1、maven目錄conf的setting.xml裏配置:java
<servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the 'id' attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | --> <server> <id>nexus-releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>admin123</password> </server> <!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> --> </servers>
2、pom.xml文件配置maven
<distributionManagement> <repository> <id>nexus-releases</id> <name>releases</name> <url>http://172.56.3.242:8081/nexus/content/repositories/releases</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>snapshots</name> <url>http://172.56.3.242:8081/nexus/content/repositories/snapshots</url> </snapshotRepository> </distributionManagement>
本地倉庫的更新ide
mvn clean package install
url
遠程倉庫的更新spa
mvn clean package deploycode