Plugin execution not covered by lifecycle configuration: org.jetbrains.kotlin:kotlin-maven-plugin:1.1.51:test-compile

Viewed 3479

I cloned the spring-boot Git repository into Eclipse and I get the following error. I have not made any code changes.

Plugin execution not covered by lifecycle configuration: 
org.jetbrains.kotlin:kotlin-maven-plugin:1.1.51:test-compile (execution: 
test-compile, phase: test-compile)

When I attempt to "auto-fix" the error I see this:

No marketplace entries found to handle kotlin-maven-plugin:1.1.51:test-
compile in Eclipse.  Please see Help for more information.

enter image description here

Here's my POM:

<plugin>
  <groupId>org.jetbrains.kotlin</groupId>
  <artifactId>kotlin-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>compile</id>
      <phase>compile</phase>
      <goals>
        <goal>compile</goal>
      </goals>
      <configuration>
        <sourceDirs>
          <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
          <sourceDir>${project.basedir}/src/main/java</sourceDir>
        </sourceDirs>
      </configuration>
    </execution>
    <execution>
      <id>test-compile</id>
      <phase>test-compile</phase>
      <goals>
        <goal>test-compile</goal>
      </goals>
      <configuration>
        <sourceDirs>
          <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
          <sourceDir>${project.basedir}/src/test/java</sourceDir>
        </sourceDirs>
      </configuration>
    </execution>
  </executions>
</plugin>

Error In Eclipse

enter image description here

1 Answers

Try

Quick Fix -> Mark goal compile as ignore in pom.xml

Choose both phases: compile & test-compile if coming from Markers list. In popup window quick fix shows only two rows with title pom.xml with line numbers respectively, check both.

It will create you block starting:

   <pluginManagement>
      <plugins>
         <!--This plugin's configuration is used to store Eclipse m2e settings only.
             It has no influence on the Maven build itself.-->
      ...

And just to stress read the comment in block: it does not affect the maven build

In case quick fix fails below is the whole plugin management section I managed to generate.

<pluginManagement>
   <plugins>
      <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
      <plugin>
         <groupId>org.eclipse.m2e</groupId>
         <artifactId>lifecycle-mapping</artifactId>
         <version>1.0.0</version>
         <configuration>
            <lifecycleMappingMetadata>
               <pluginExecutions>
                  <pluginExecution>
                     <pluginExecutionFilter>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-plugin</artifactId>
                        <versionRange>[1.1.60,)</versionRange>
                        <goals>
                           <goal>compile</goal>
                           <goal>test-compile</goal>
                        </goals>
                     </pluginExecutionFilter>
                     <action>
                        <ignore></ignore>
                     </action>
                  </pluginExecution>
               </pluginExecutions>
            </lifecycleMappingMetadata>
         </configuration>
      </plugin>
   </plugins>
</pluginManagement>
Related