简体   繁体   中英

Plugin execution not covered by lifecycle configuration if trying to use ActiveJdbc under Eclipse

I have entered required config into my pom.xml to develop with ActiveJdbc , which includes one dependency and one plugin.

Dependency went ok, while plugin caused error message from Eclipse:

Plugin execution not covered by lifecycle configuration

在此处输入图片说明

I am new to plugins, and understand neither the error message nor the provided quick fixes.

What do they mean?

UPDATE

If I wrap <plugins> section into <pluginManagement> tag, error disappears. But at the same time, instrumentation does not execute anymore.

Is it possible to both remove an error message and leave instrumentation performed in Eclipse?

This is an error raised by the new M2E plugin (starting with version 1.0) when it encounters a plugin that has no lifecycle mapping information, which explicitly tells M2E how to handle the plugin executions. Personally, I have no problem sticking to the old m2eclipse (version 0.12) most of the time as long as it builds everything fine.

Still, to remove this error, you may try adding the following lifecycle mapping metadata for the activejdbc-instrumentation plugin to execute its goal:

...
<pluginManagement>
   <plugins>
      <plugin>
         <groupId>org.eclipse.m2e</groupId>
         <artifactId>lifecycle-mapping</artifactId>
         <version>1.0.0</version>
         <configuration>
            <lifecycleMappingMetadata>
               <pluginExecutions>
                  <pluginExecution>
                     <pluginExecutionFilter>
                        <groupId>org.javalite</groupId>
                        <artifactId>activejdbc-instrumentation</artifactId>
                        <versionRange>[1.4.9,)</versionRange>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                     </pluginExecutionFilter>
                     <action>
                        <execute />
                     </action>
                  </pluginExecution>
               </pluginExecutions>
            </lifecycleMappingMetadata>
         </configuration>
      </plugin>
   </plugins>
</pluginManagement>

<plugins>
   <plugin>
      <groupId>org.javalite</groupId>
      ...

See http://wiki.eclipse.org/M2E_plugin_execution_not_covered for more information about this error.

Apparently, according to the type of pom packaging the build binds to different lifecycle phases by default. If you were trying to run the execution in phase: process-classes, try changing it into one the pom packagin has to go through. I'm not sure if this is the right way to fix it but it works for me. In the maven build lifecycle you can see that the pom packaging binds to packaging type, install and deploy, so if this was your package try modifing phase to "package" for example, which for the pom type would be the first phase.

Now if you run it in the console it will work but in eclipse will mark the error. If you change the phase then the error will go away and you can still run it.

This is more likely a quick fix but if you just want to make sure that it executes before the other plugins in the pom just make sure it is on a previous phase and not necesarily in the one it belongs to.

This is purely a eclipse plugin issue. Here are two solutions

  1. Your project will try to build from command line. Try mvn clean install
  2. You can switch to intellij - this has much better native support for maven without any plugin needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM