Upload the jar package to the nexus private server

Source: Internet
Author: User
1. upload via webpage

This method only uploads the jar package. You cannot obtain jar Dependencies by referencing the current jar through Maven.


From pom, select the POM file and jar. When jar is introduced through Maven, the jar dependency is automatically loaded.


2. depoly through Maven

InMaven CONF/setting. xmlConfigure the management account of the nexus private server

Add Server under the servers label

   <server>      <id>nexus-snapshots</id>      <username>repouser</username>      <password>repopwd</password>    </server>

ID: You can define a name and the password of the Administrator account of the private server.

Configure the 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 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 server ID in settings. xml


After the project package

mvn deploy

You can upload the jar to the nexus private server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.