nexus版本:nexus-3.37.3-02-win64,在2.x的nexus上面,不適用,不過原理一樣,就配置不一樣而已
1.配置setting.xml
2.上傳jar包 (cmd命令)
3.上傳jar包(pom文件,在idea使用mvn插件上傳)
4.上傳到自己創建的倉庫
1.配置setting.xml
ps:名字取名:aa,後面上傳命令用到
<server>
<id>aa</id>
<username>admin</username>
<password>admin</password>
</server>
2.上傳jar包 (cmd命令)
名字:aa,之前的命名
mvn deploy:deploy-file "-DgroupId=com.ligy" "-DartifactId=nexus2" "-Dversion=1.0-SNAPSHOT" "-Dpackaging=jar" "-Dfile=D:\IdeaProjects\nexus2\target\nexus2-1.0-SNAPSHOT.jar" "-Durl=http://localhost:8081/repository/maven-snapshots/" "-DrepositoryId=aa"
3.上傳jar包(pom文件,在idea使用mvn插件上傳)
這裏把版本號,改爲:2.0-SNAPSHOT
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.ligy</groupId> <artifactId>nexus2</artifactId> <version>2.0-SNAPSHOT</version> <distributionManagement> <snapshotRepository> <id>aa</id> <name>aaaaaa</name> <url>http://localhost:8081/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement> </project>
4.上傳到自己創建的倉庫
先創建自己的倉庫:demo1-ligy