Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Datanucleus Maven Plugin

Tags:

eclipse

maven

How to fix this issue with Eclipse maven project:

Plugin execution not covered by lifecycle configuration: org.datanucleus:maven-datanucleus-plugin:3.1.0-m3:enhance (execution: default, phase: compile) pom.xml /DatanucleusJPA line 218 Maven Project Build Lifecycle Mapping Problem

Is this fixable with the Eclipse M2 Eclipse plugin?

like image 536
quarks Avatar asked Jul 24 '12 06:07

quarks


1 Answers

Preface:

I suppose this is nothing Datanucleus specific at all, but a feature of Eclipse Maven plugin instead. All that you have tried, apparently works if running on command line (Linux) or Cygwin[1] (Windows). The issue here is that Eclipse m2 plugin needs some more info for working properly and make its tricks and that is where the question lies and that's why you asked.

Possible solutions:

Like pointed already in comments, every detail can be found from the given link to [2] M2E site, and the essentials appear in one answer to one question [3] about the same issue. I take this snippet from one of it's answers:

<action>
    <execute />
</action>

These lines should be fine, added inside the last element inside your <plugin-executions> element on your project pom.xml. I am not magician, I can only use Google, so without code / pom content given in question I suggest you have followed Datanucleus own instructions [4] and had there something like:

<plugins>
    <plugin>
        <groupId>org.datanucleus</groupId>
        <artifactId>maven-datanucleus-plugin</artifactId>
        <version>3.1.0-m3</version>
        <configuration>
            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
            <verbose>true</verbose>
        </configuration>
        <executions>
            <execution>
                <phase>process-classes</phase>
                <goals>
                    <goal>enhance</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

..and well, there it is only <executions>, but place it there.

Sidenote:

Funny though, while using Google for searching what would be the issue, that question was already voted up by me and there my answer of choice was different, looking like this:

<build>
    <pluginManagement>
        <plugins>
             <plugin> ... </plugin>
             <plugin> ... </plugin>
              ....
         </plugins>
    </pluginManagement>
</build>

..the trick being to add that <pluginmanagement> part to the xml. I just remember to have taken a fresh copy of my projects from SVN and after that I did not use that trick anymore. Maybe that problem is old or someone in my company committed that trick. Anyways, worth of testing, too.

Answer to the question:

Not, not directly with plugin, but tweak the pom.xml file.

My sources:

[1] http://cygwin.com - running Linux commands at Windows.
[2] http://wiki.eclipse.org/M2E_plugin_execution_not_covered - suggested in comments
[3] How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds - includes lines of quotation

like image 182
mico Avatar answered Oct 27 '22 14:10

mico