0

After upgrading to Eclipse Luna and installing the m2e plugin this morning, my project is now showing an error in the pom file for my project. The errors are:

- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.6:testResources (execution: default-testResources, phase: process-test-resources)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.6:resources (execution: default-resources, phase: process-resources)

My original pom.xml looked like this:

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.example</groupId>
   <artifactId>TestProject</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <dependencies>
      <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
         <version>6.8.8</version>
      </dependency>
      <dependency>
         <groupId>org.seleniumhq.selenium</groupId>
         <artifactId>selenium-java</artifactId>
         <version>2.42.0</version>
      </dependency>
   </dependencies>
   <build>
      <directory>target</directory>
      <outputDirectory>target/classes</outputDirectory>
      <finalName>${project.artifactId}-${project.version}</finalName>
      <sourceDirectory>src/main/java</sourceDirectory>
      <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
      <resources>
         <resource>
            <directory>src/main/resources</directory>
         </resource>
      </resources>
      <testOutputDirectory>target/test-classes</testOutputDirectory>
      <testSourceDirectory>src/test/java</testSourceDirectory>
      <testResources>
         <testResource>
            <directory>src/test/resources</directory>
         </testResource>
      </testResources>
   </build>
</project>

I tried updating it via the docs here: http://wiki.eclipse.org/M2E_plugin_execution_not_covered

And it now looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.example</groupId>
   <artifactId>TestProject</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <dependencies>
      <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
         <version>6.8.8</version>
      </dependency>
      <dependency>
         <groupId>org.seleniumhq.selenium</groupId>
         <artifactId>selenium-java</artifactId>
         <version>2.42.0</version>
      </dependency>
   </dependencies>
   <build>
      <directory>target</directory>
      <outputDirectory>target/classes</outputDirectory>
      <finalName>${project.artifactId}-${project.version}</finalName>
      <sourceDirectory>src/main/java</sourceDirectory>
      <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
      <resources>
         <resource>
            <directory>src/main/resources</directory>
         </resource>
      </resources>
      <testOutputDirectory>target/test-classes</testOutputDirectory>
      <testSourceDirectory>src/test/java</testSourceDirectory>
      <testResources>
         <testResource>
            <directory>src/test/resources</directory>
         </testResource>
      </testResources>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
         </plugin>
         <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
               <lifecycleMappingMetadata>
                  <pluginExecutions>
                     <pluginExecution>
                        <pluginExecutionFilter>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-resources-plugin</artifactId>
                           <versionRange>[1.0.0,)</versionRange>
                           <goals>
                              <goal>resources</goal>
                              <goal>testResources</goal>
                           </goals>
                        </pluginExecutionFilter>
                        <action>
                           <ignore />
                        </action>
                     </pluginExecution>
                  </pluginExecutions>
               </lifecycleMappingMetadata>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

However, the error still shows up. So, there must be something wrong with this config, can someone point me to where I'm going wrong?

Axl
  • 427
  • 2
  • 7
  • 19

1 Answers1

0

Adding the <pluginManagement> tag per the accept answer here took care of my issue: How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds

I thought I had tried that, but apparently I wasn't doing it correctly.

Community
  • 1
  • 1
Axl
  • 427
  • 2
  • 7
  • 19