Maven Dependency Management in MyEclipse

Source: Internet
Author: User

1. MAVEN supports unique dependencies

Apache Maven is a comprehensive tool for software project management. Based on the concept of the Project object Model (POM), MAVEN can manage a project's dependencies, builds, reports, and some of the documentation for the information center.

Dependency management is one of the most well-known features of Maven and one of the areas that Maven excels in, but it is not always possible to take advantage of this functionality. Almost all of the ways you need to configure a MAVEN-based project, add and configure Maven plugins, process files, and goals. While MyEclipse fully supports the most advanced MAVEN features, if you only want to manage dependencies, creating a complete MAVEN project creates unnecessary project complexity, which is why the only dependency pattern arises.

Starting with the CI 7 release, MyEclipse supports the use of MAVEN dependency resolution without the need for full MAVEN build management.

2. MAVEN supports--dependencies only Facet

In MyEclipse CI 7 and later, you can find two maven-related project facets. MAVEN supports Java EE Projects facets and provides complete MAVEN functionality for your project. MAVEN support for--dependencies only facet provides a unique dependency management feature for your project.

Maven Support–dependencies only Facet

When you install the dependencies only facet, a maven dependency classpath container that specifies all maven dependencies in Pom.xml is added to your project. This container will also be deployed when you deploy this project, and one will be generated if the pom.xml file does not exist.

You can make any changes to Pom.xml, but dependency information cannot be changed, and the Maven dependency container updates it accordingly. All other project configuration metadata is ignored and there is no need to bother with the MAVEN settings on the attachment.

Note : Maven support for Java EE Projects facet and MAVEN support--dependencies only facet is mutually exclusive. For full maven support, you must use the former.

3. Use Cases

The following sections provide steps for using MAVEN Dependencies only facets in several cases.

3.1 Adding a unique dependency pattern for a new project
    1. Create a new WEB/EJB project; Do not select the Add maven support check box.
    2. Right-click the project and select Properties.
    3. Expand MyEclipse, and then select Project Facets.
    4. Select Maven support–dependencies only facet.
    5. Click OK or apply.
3.2 Using a dependency unique pattern in an existing MAVEN project
    1. Right-click the project and select Properties.
    2. Expand MyEclipse, and then select Project Facets.
    3. Cancels the MAVEN support for Java EE Projects To uninstall the full Maven support facet.
    4. Select Maven support–dependencies only facet.
    5. Click OK or apply.
3.3 migrating Maven projects from MyEclipse 10.x or lower

MyEclipse 10.x or earlier in the main processing MAVEN support unique dependencies are not perfect if your project does not have a properly configured pom.xml file when the project is migrated to MyEclipse 2013 or later , problems may occur during the deployment process. Please reset your project status and migrate to MyEclipse 2015, then perform the following steps before migrating.

    1. Open the project on the main menu bar and Disable auto-build (make sure it is not selected).
    2. Import/Check out your project runs into the MyEclipse 2015 working interval.
    3. When you are prompted to migrate the project, cancel the process or cancel the affected item.
    4. Add the Maven support–dependencies only facet to your project as described above.
    5. Enable automatic builds .
    6. Choose Myeclipse>migrate Workspace to complete the migration of these MAVEN projects.

The deployment should now resemble the deployment in MyEclipse 10.x.

Note : This process will continue to be streamlined in future versions of MyEclipse.

When you are ready to switch to the full MAVEN-based configuration, simply uninstall this facet and then install the MAVEN support for Java EE Projectsfacet.

MyEclipse official Chinese online line, welcome to download Communication!

Maven Dependency Management in MyEclipse

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.