How to upload jar package to private server
Steps to manually upload a third-party jar package to nexus:
1) Proceed as shown below
2) Complete the upload as shown below
3) Click Save to finish
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 upload via web
This method just uploads the jar package. Refer to the current jar through maven, and the dependency of the jar cannot be obtained
From pom, select the pom file and jar. When the jar is imported through maven, the dependencies of the jar will be automatically loaded
2 depoly through maven
Configure the management account of nexus private server in maven conf/setting.xml
Add server under the servers tab
-
<server>
-
<id>nexus-snapshots</id>
-
<username>repouser</username>
-
<password>repopwd</password>
-
</server>
ID can define a name and the account password of the management management of the private server
Configure nexus private server under mirrors and profiles
-
<mirrors>
-
<mirror>
-
<!--This sends everything else to /public -->
-
<id>nexus</id>
-
<mirrorOf>*</mirrorOf>
-
<url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>
-
</mirror>
-
</mirrors>
-
<profiles>
-
<profile>
-
<id>nexus</id>
-
<!--Enable snapshots for the built in central repo to direct -->
-
<!--all requests to nexus via the mirror -->
-
<repositories>
-
<repository>
-
<id>nexus</id>
-
<name>local private nexus</name>
-
<url>http://192.168.10.8:18080/nexus/content/groups/public</url>
-
<releases><enabled>true</enabled><updatePolicy>always</updatePolicy>
-
<checksumPolicy>warn</checksumPolicy></releases>
-
<snapshots><enabled>false</enabled></snapshots>
-
</repository>
-
</repositories>
-
<pluginRepositories>
-
<pluginRepository>
-
<id>nexus</id>
-
<name>local private nexus</name>
-
<url>http://192.168.10.8:18080/nexus/content/groups/public</url>
-
<releases><enabled>true</enabled><updatePolicy>always</updatePolicy>
-
<checksumPolicy>warn</checksumPolicy></releases>
-
<snapshots><enabled>false</enabled></snapshots>
-
</pluginRepository>
-
</pluginRepositories>
-
</profile>
-
</profiles>
-
<activeProfiles>
-
<!--make the profile active all the time -->
-
<activeProfile>nexus</activeProfile>
-
</activeProfiles>
Configure in the pom.xml of the project
-
<distributionManagement>
-
<repository>
-
<id>nexus-releases</id>
-
<name>Nexus Release Repository</name>
-
<url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>
-
</repository>
-
<snapshotRepository>
-
<id>nexus-snapshots</id>
-
<name>Nexus Snapshot Repository</name>
-
<url>http://192.168.10.8:18080/nexus/content/repositories/snapshots/</url>
-
</snapshotRepository>
-
</distributionManagement>
id corresponds to the id of the server in settings.xml
When the project is packaged
mvn deploy
You can upload the jar to nexus private server