Nexus2 can upload jar packages to private libraries through the admin interface, but the newest NEXUS3 can't find the upload interface and can only be published to private libraries in the following ways.
Publishing third-party jar packages
In this case, the MAVEN remote repository does not have a local third-party jar package that needs to be published to the private library.
mvn deploy:deploy-file -DgroupId=com.example -DartifactId=test -Dversion=0.0.1 -Dpackaging=jar -Dfile=E:\workspace\test\WebRoot\WEB-INF\lib\test-0.0.1.jar -Durl=http://nexus.example.com:8081/repository/3rd-repo/ -DrepositoryId=Nexus
Note that the file directory cannot be the same as the local repository directory, or it will be an error.
Publish your own project
The company's own projects need to be published to the Nexus Private library for other people to rely on, then can be used in the above way to make a jar package and then release, you can also use Maven's eclipse plugin.
Add maven POM Configuration:
<distributionManagement> <repository> <id>Nexus</id> <name>Releases</name> <url>http://nexus.example.com:8081/repository/maven-releases</url> </repository> <snapshotRepository> <id>Nexus</id> <name>Snapshot</name> <url>http://nexus.example.com:8081/repository/maven-snapshots</url> </snapshotRepository></distributionManagement>
Then use Run as on the Eclipse project. >maven build: In goals, enter deploy to release.
Maven Settings configuration
Above two points where Nexus refers to the MAVEN server ID, case sensitive, adds the following configuration.
<servers> <server><id>Nexus</id> <username>admin</username> <password>admin123</password> </server> </servers>
The use of Maven and the construction of the private library can be browsed through the previous Maven collection of articles.
How Maven publishes the jar package to the Nexus private library