Maven deploy jar

Source: Internet
Author: User

MVN: deploy runs in an integrated or released environment and copies the final version package to a remote repository, so that other developers or projects can share the package.

 

Take uploading ojdbc14 to thirdparty in nexus as an example.

 

1. configure settings. xml

 

Because nexus requires login, you can configure login-free.

In settings. XML, <servers> </servers>

<Server>
<ID>Thirdparty</ID>
<Username> admin </username>
<Password> admin123 </password>
</Server>

 

Of course, if you want to upload a package to another warehouse, follow this example, such

 

<Server>
<ID>Central</ID>
<Username> admin </username>
<Password> admin123 </password>
</Server>

 

If return code is: 401 error is returned during deploy, You need to perform user verification or the information you have already verified is incorrect.

 

 

2. Run cmd to enter the command

 

MVN deploy: deploy-file-dgroupid = com. XY. oracle-dartifactid = ojdbc14-dversion = 10.2.0.4.0-dpackaging = jar-dfile = E: \ ojdbc14.jar-durl = http: // localhost: 9090/nexus-2.2-01/content/repositories/thirdparty/-drepositoryid =Thirdparty

 

Dgroupid and dartifactid constitute the coordinates of the jar package in POM. XML, and the project is located based on these two attributes. You can also set your own name.

Dfile indicates the absolute path of the jar package to be uploaded.

Durl: the location of the repository on the private server. Open the nexus --> repositories menu to view the path.

The ID of the drepositoryid server, which can be seen in the nexus configuration.

Dversion indicates version information,How can I get an accurate version of a jar package?

Decompress the package and you will find a file named manifest. MF, which contains the version information that describes the package.

For example, manifest-version: 1.0 indicates the version of the package.

 

After the package is uploaded successfully, click 3rd party repository on the nexus page to view the package.

 

Maven deploy jar

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.