Eclipse cannot build, and there is a cross on the POM File

Source: Internet
Author: User
Tags jboss

Error message:

execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (execution: default-jar, phase: process-classes)

Pom. the XML file has a cross in eclipse, and the above is error MSG. check online materials and read pom from eclipse. XML: Execute the plug-in pom. if the m2e plug-in does not support all the plug-ins in POM, eclipse will prompt the Pom. XML file error.

Solution: download and install the m2e-wtp plug-in, which can be found in eclipse market. will solve most of eclipse Read Pom. xml errors.

Let's take a look at the description of the m2e-wtp plug-in: Probably enhance Maven support in eclipse, relying on war/ejp/ear/RAR .....

Maven Integration for Eclipse WTP (a.k.a m2e-wtp) aims at providing a tight integration between Maven Integration for Eclipse (a.k.a m2e) and the Eclipse Web Tools Project (WTP) .m2e-wtp provides a set of m2e connectors used for the configuration of Java EE projects in WTP. It features :•Support for war projects : adds the Java and Dynamic Web Facets. Support war overlays and on-the-fly resource filtering•Support for ejb projects : adds the Java and EJB Facets.•Support for ear projects : adds the EAR Facet. Supports application.xml and jboss.xml file generation, resource filtering•Support for rar projects : adds the Java and Connector Facets.•Support for app-client projects : adds the Java and Application Client Facets. Supports deployment descriptor filtering.•Support for web-fragment projects : adds the Java and Web Fragment Facets if a web-fragment.xml file is detected in the resource folders.•Support for jar dependency projects : adds the Java and Utility Facets.Note that m2e-wtp requires m2e-wtp 1.0. You must make sure m2e's update site (http://download.eclipse.org/technology/m2e/releases/) is defined in :Window > Preferences > Install / Update > Available Software SitesSince m2e 1.0 is incompatible with previous versions, you may have to uninstall old m2e and m2e-wtp versions before proceeding with the installation.

Let's take a look at Eclipse:

Project can be built, delete and re-import. the Pom. xml and project forks are gone. Open Pom. xml and dependency hierarchy. Now you can view the dependency.

 

Legacy Issue 1:

1. MAVEN-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e.

<!--My pom.xml segment-->...................<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-dependency-plugin</artifactId><executions><execution><id>copy-mar-dependencies</id><phase>process-resources</phase><goals><goal>copy-dependencies</goal></goals><configuration><includeTypes>mar</includeTypes><outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/modules</outputDirectory></configuration></execution><execution><id>copy-aar-dependencies</id><phase>process-resources</phase><goals><goal>copy-dependencies</goal></goals><configuration><includeTypes>aar</includeTypes><outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/services</outputDirectory></configuration></execution></executions></plugin>......................

Solution:

Cause: I used two eclipse, which was caused by the m2e plug-in, but this problem was not found in m2eclipse. Of course, you can use other packaging plug-ins. This is not required, so you only need to know the cause and solution. It may not be solved by changing the environment. You can change the plug-in. Http://blog.csdn.net/sebatinsky/article/details/6273977

After the installation is successful, sometimes the project will display an exclamation point, as long as the update dependency, the exclamation point becomes a cross, and then build again OK. the project can be compiled using eclipse and replaced with the class file in JBoss.

 

Question 2: The Maven prompts that JDK cannot be found. It does not affect your use of Maven in eclipse.

The answer to the question is everywhere. I want to say: I tried it all, no matter how it works, create a shortcut,

Add: D: \ tools \ MVN + de \ eclipse \ eclipse.exe-VM "C: \ Program Files \ Java \ jdk1.6.0 _ 30 \ bin \ javaw.exe". solution.
 

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.