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