Search code examples
springmavenspring-mvcpom.xmleclipse-kepler

Plugin execution not covered by lifecycle configuration


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 :


Solution

  • 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.