4

Beginner of Spring

Background : So far, i have been working on core JAVA and now i need to switch to MVC
Trying to make my first Spring MVC Hello World Example from this tutorial , i am getting below error on pom.xml:

Multiple annotations found at this line: - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin: 2.3.2:compile (execution: default-compile, phase: compile) - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin: 2.5:testResources (execution: default-testResources, phase: process-test-resources) - <packaging>war</packaging> - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin: 2.5:resources (execution: default-resources, phase: process-resources) - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin: 2.3.2:testCompile (execution: default-testCompile, phase: test-compile) 

Error is generated on this line of pom.xml :

 <packaging>war</packaging> 

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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.javacodegeeks.snippets.enterprise</groupId> <artifactId>springexample</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>springexample Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> </dependencies> <build> <finalName>springexample</finalName> </build> <properties> <spring.version>4.0.2.RELEASE</spring.version> </properties> </project> 

I even installed m2e after searching in marketplace

Please go easy, this question comes in as an attempt to learn something totally new to me.
Do i need some plugin or something to resolve this? If so, is there any universal kind of plugin to avoid any such future error?
IDE : Eclipse Kepler

P.S :

I have already browsed old threads but no luck :

2 Answers 2

6

That is no reason to stop using m2e, you can fix those errors by simply right-clicking them and using Quick Fix command. You will have the option to search for available lifecycle configurators in Marketplace to automatically handle it or, if there is none, you could tell m2e to ignore the plugin.

Sign up to request clarification or add additional context in comments.

1 Comment

Quite usefull answer. I haven't look at maven eclipse project like that. Thanks
2

The problem is that m2e requires one eclipse plugin for each maven plugin that you use (it's actually a bit more complex than that, but in practice, there is an almost one to one correspondence between Eclipse plugins and maven plugins for your project).

There are two solutions:

  1. Use the maven-eclipse plugin to automatically generate all of your eclipse project files. From the command line, run mvn eclipse:eclipse to do this. You should also uninstall m2e so that it doesn't try to manage your maven project.
  2. Install Spring-Ide. I'd recommend going with a fresh installation, but you can also install it into an existing instance of Eclipse. This comes pre-installed with all of the m2e plugins that you will need.

7 Comments

do i need to uninstall m2e first then run mvn eclipse:eclipse?
It's easiest to do it through inside the IDE. Help -> About Eclipse -> Installed Software -> (Select m2e) -> Uninstall...
There is a command line way to do this. See the p2 director application (already installed with your Eclipse): wiki.eclipse.org/Equinox/p2/Director_application
And, no, you don't need to uninstall m2e at all. It's just that I've seen m2e get confused when it is combined with maven Eclipse plugin. YMMV.
awesome...POM error is solved, but my project still shows that little red cross mark on the main project name, though any subfolder is not showing it....any thoughts on that too?
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.