download
https://www.sonatype.com/download-oss-sonatype
Install as a service
https://help.sonatype.com/repomanager3/installation/run-as-a-service
windows
nexus.exe /install
nexus.exe /start
nexus.exe /stop
nexus.exe /uninstall
Do not enter <optional-service-name>
, the default isnexus
You need to open cmd in ==Administrator mode==
cd nexus catalog \ bin
nexus.exe /install nexus
Log: Installed service 'nexus'.
nexus.exe /start nexus
Visit http://127.0.0.1:8081
Username/Password: admin/admin123
pit
ping different 127.0.0.1
It should be that there are too many problems with the virtual machine network card settings recently, which has caused some problems.
Start cmd
netsh winsock reset
restart the computer, solve
configure maven
Add the corresponding warehouse username and password
conf/setting.xml
<servers>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
maven project
Only repair this project
pom.xml
<distributionManagement>
<repository>
<id>nexus-releases</id>
<name>Nexus Release Repository</name>
<url>http://127.0.0.1:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://127.0.0.1:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
Modify the machine
conf/setting.xml
publish to repository
mvn deploy
Releases/snapshot version distinction According to whether there is a suffix of the version number, it can -SNAPSHOT
be released to releases or to the snapshot directory.