Myeclipse&maven Project Management Tutorial: Creating a Java Maven Dependent project (reprinted)

Source: Internet
Author: User

This tutorial shows you how to create a generic Java/maven project from a MyEclipse Web project, or any other MAVEN project. These steps include the creation of the foundation and the use of MAVEN dependencies. You will learn to:

Create a MAVEN utility project to add dependencies for a Project add utility as a dependency relationship

No myeclipse? Download Now

  1. Create a MAVEN utility project

Maven utility projects will be consumed by existing MAVEN projects.

(1) Create a MAVEN project that supports consuming the projects created in this tutorial.

(2) Select File>new>project, enter the MAVEN type in the Search field, select the MAVEN project, and click Next.

  

Create a new MAVEN project

(3) Select the Create a simple project check box, and then click Next.

(4) Enter the group and artifact IDs, and the project name, then click Finish.

  

Project configuration

  2. Adding dependencies for a utility project

(1) Right-click the utility and select Maven4myeclipse>add Dependency.

(2) commons-logging type or other dependencies in Enter ... Search dependency fields.

  

Select a dependency

(3) Select the dependency and click OK.

(4) Expand the Utility project, right-click the Pom.xml file and select Run As>maven install file to the local repository.

  

Installing files to a local repository

When the console displays "Build successful", the utility project is available for other projects to reference.

  

A successful build

  3. Adding utility projects as a dependency

(1) Right-click Consuming project and select Maven4myeclipse>add Dependency.

(2) Enter field, type Com.mycompany, or group ID when you create a utility project.

  

Add a utility project as a consumer-dependent project

(3) Select the utility item and click OK. The dependencies are added to the pom.xml file of the consuming project.

(4) Right-click Consuming Project's pom.xml file and select Run As>maven Build.

  

MAVEN build Configuration

(5) Select the target, edit the other necessary build configurations, and click Run. The console will see a build success message.

  Note : If you click the Select button to specify that the target list of targets is empty, then you need to enable the full repository index. To do this, first open the Maven repositories view and expand global repositories. Right-click Central, and then select Start Full index. It takes a few minutes for the index to update.

  

Full Library index Enabled

Myeclipse&maven Project Management Tutorial: Creating a Java Maven Dependent project (reprinted)

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.