Maven (vi) Eclipse uses MAVEN deploy command deployment to build to Nexus

Source: Internet
Author: User

Reproduced in: http://blog.csdn.net/jun55xiu/article/details/43051627

1 Scenario: Sys-util (System Tools) project deployment, build- to-jar (Sys-util-xxx.jar) storage on a nexus for use by other projects (dependencies)

2 Purpose: To develop different versions of JAR packages (such as Sys-util-0.0.1.jar,.................... in each cycle through the Nexus Web server Management project Sys-util-1.0.1.jar)

3 Operation Process:

1) Create Sys-util (System Tools) project, MAVEN project

2 Configuring the Sys-util (System Tools) Project Pom.xml file, specifying the Nexus URL location where the project is stored (refer to the configuration above)

3) Right-click the project and execute: Run as--and run configurations---> Maven build--->new _configuration (double-click Maven build to generate)-Bro WSE Workspace selected Items,

Goals Input: DEPLOY-E, click Run

2:

3.2) Additional details

1 clarifying Nexus local MAVEN repository policy (policies)

Nexus pre-defined 3 local warehouses, releases,snapshots, and 3rd party respectively. Each of the three warehouses has its own clear purpose. Releases is used to deploy our own release artifacts, snapshots is used to deploy our own snapshot artifacts, and the 3rd party is used to deploy third parties, some of which are JDBC drivers for Oracle, and we can't download them from a public repository. We need to deploy it to our own warehouses.

Of course you can also create your own local warehouse, similar to creating a proxy warehouse, click the Add button above the Repository panel, then select Hosted Repository, then enter the ID and name in the configuration panel below, Note that here we no longer need to fill out the remote warehouse address, Repository type is non-modifiable hosted, and about Repository Policy, you can choose release or snapshot according to your own needs

Purpose: Submit the jar package to the Nexus on the warehouse policy in Eclipse POM. XML file to correspond to

POM. Xml:

<project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
<modelVersion>4.0.0</modelVersion>
<groupId>com.vrv</groupId>
<artifactId>SYS-UTIL</artifactId>
<version>1.0.1</version><!-- corresponds to releases policy (strategy)--

<!-- <version>1.0.1-snapshots</version> corresponding snapshotspolicy (strategy)--
<packaging>jar</packaging>

<dependencies>

。。。

This is to be submitted to the public jar package: Bast-util (System Tools) project to:

Http://192.168.3.10:88:8081/nexus/content/repositories/vrv_FrameWork

2 Open the user's corresponding deployment Policy permission, allow uploading deployment, otherwise it will be reported: Maven error code, bad request

3 Configure the authentication to unify, otherwise will report: Return code is:401, reasonphrase:unauthorized.

Maven Directory conf in Setting.xml

<server>

<ID>vrv_framework</ID>

<username>cj</username>

<password>xxxx</password>

</Server>

The address of the remote deploy in the pom.xml corresponds to the same

Configuration in Pom.xml:

<distributionManagement>
<repository>
<id>Vrv_FrameWork</id>
<name>vrv_FrameWork</name>
<url>http://192.168.3.10:88:8081/nexus/content/repositories/vrv_FrameWork</url>
</repository>
</distributionManagement>
<build>
<finalName>SYS-UTIL</finalName>
</build>

4 goals input again: After deploy-e, click Run to submit the jar to the Nexus server

5

Maven (vi) Eclipse uses MAVEN deploy command deployment to build to Nexus

Related Article

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.