How to upload jar package to private server

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

 
  1.    <server>

  2.       <id>nexus-snapshots</id>

  3.       <username>repouser</username>

  4.       <password>repopwd</password>

  5.     </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

 
  1. <mirrors>

  2.     <mirror>

  3.       <!--This sends everything else to /public -->

  4.       <id>nexus</id>

  5.       <mirrorOf>*</mirrorOf>

  6.       <url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>

  7.     </mirror>

  8.   </mirrors>

  9.   <profiles>

  10.     <profile>

  11.       <id>nexus</id>

  12.       <!--Enable snapshots for the built in central repo to direct -->

  13.       <!--all requests to nexus via the mirror -->

  14.       <repositories> 

  15.         <repository> 

  16.             <id>nexus</id> 

  17.             <name>local private nexus</name> 

  18.             <url>http://192.168.10.8:18080/nexus/content/groups/public</url> 

  19.             <releases><enabled>true</enabled><updatePolicy>always</updatePolicy>

  20.             <checksumPolicy>warn</checksumPolicy></releases> 

  21.             <snapshots><enabled>false</enabled></snapshots> 

  22.         </repository>        

  23.       </repositories> 

  24.       <pluginRepositories> 

  25.         <pluginRepository> 

  26.             <id>nexus</id> 

  27.             <name>local private nexus</name> 

  28.             <url>http://192.168.10.8:18080/nexus/content/groups/public</url> 

  29.             <releases><enabled>true</enabled><updatePolicy>always</updatePolicy>

  30.             <checksumPolicy>warn</checksumPolicy></releases> 

  31.             <snapshots><enabled>false</enabled></snapshots> 

  32.         </pluginRepository>        

  33.        </pluginRepositories> 

  34.     </profile>

  35.   </profiles>

  36.   <activeProfiles>

  37.     <!--make the profile active all the time -->

  38.     <activeProfile>nexus</activeProfile>

  39.   </activeProfiles>

Configure in the pom.xml of the project

 
  1.  <distributionManagement>

  2.         <repository>

  3.             <id>nexus-releases</id>

  4.             <name>Nexus Release Repository</name>

  5.             <url>http://192.168.10.8:18080/nexus/content/repositories/releases/</url>

  6.         </repository>

  7.         <snapshotRepository>

  8.             <id>nexus-snapshots</id>

  9.             <name>Nexus Snapshot Repository</name>

  10.             <url>http://192.168.10.8:18080/nexus/content/repositories/snapshots/</url>

  11.         </snapshotRepository>

  12.     </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

Guess you like

Origin blog.csdn.net/yucaifu1989/article/details/112980609
Recommended