Eclipse creates the MAVEN parent-child Project

Source: Internet
Author: User
Tags java web

MAVEN projects in work often have parent-child structures, and there are interdependent relationships in the substructure project. 1, the project needs

To create a MAVEN parent-child project in Eclipse today, for example, you need to build a MAVEN project with the following relationships.


2, build a parent Maven project create a new MAVEN project, as shown in the following illustration: Select the default workspace, work set, and click "Next" to select the "Maven-archetype-quickstart" type , click "Next" to fill in the group ID, artifact ID, Version, click "Finish" the project is completed, the project structure will be deleted except Pom.xml files, then click the Maven "Update Project" button
after refreshing, the parent project is structured as follows
This project will be used to establish its subproject
3, build a child Maven project using Eclipse to build a maven subproject is simple, Open the Pom.xml file for the parent project, modify the packaging type to Pom, and after saving, the Modules option can be expanded. (If the Pom file is an error, refresh it with maven)
Click the "Create" button in the Modules option to create a child Maven project

Fill in module Name and then click Next
to select the corresponding type, which is generally more than two types. Maven-archetype-quickstart is a normal Java project, Maven-archetype-webapp for Java Web Project
Click Finish, Eclipse automatically creates a subproject named Wood-service Project and is a wood-project, at which point you can see the subproject's folder in your parent project, indicating that the creation was successful, and the Pom file for the parent-child project was automatically configured and no more configuration required

You can then use this method to establish multiple subprojects, as shown in the following illustration:

4, building dependencies building dependencies is simpler, if wood-web projects need to rely on wood-service projects, Then open the Pom file in the Wood-web project and add the following code:

At this point, Eclipse created the MAVEN parent-child project is complete.

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.