craigday / eclipselink-staticweave-maven-plugin

Automatically exported from code.google.com/p/eclipselink-staticweave-maven-plugin
4 stars 5 forks source link

Error in pom.xml with maven 3.0.3 and Eclipse Juno #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add the plugin declaration in pom.xml
2. save the pom.xml
3. Eclipse IDE says an error :
Plugin execution not covered by lifecycle configuration: 
au.com.alderaan:eclipselink-staticweave-maven-plugin:1.0.4:weave (execution: 
default, phase: process-classes)

What version of the product are you using? On what operating system?
1.0.4 with Eclipse Juno and maven 3.0.3.

My Plugin declaration is the following :
<build>
        <plugin>
                <artifactId>eclipselink-staticweave-maven-plugin</artifactId>
                <groupId>au.com.alderaan</groupId>
                <version>1.0.4</version>
                <executions>
                    <execution>  !!! The error is located here
                        <goals>
                            <goal>weave</goal>
                        </goals>
                        <phase>process-classes</phase>
                        <configuration>
                            <logLevel>ALL</logLevel>
                            <includeProjectClasspath>true</includeProjectClasspath>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.persistence</groupId>
                        <artifactId>eclipselink</artifactId>
                        <version>2.4.0</version>
                    </dependency>
                </dependencies>
            </plugin>

Original issue reported on code.google.com by the.jmcnet.team on 14 Feb 2013 at 11:32

GoogleCodeExporter commented 9 years ago
I dont think this is an issue with the plugin. Googling gives me some useful 
results:

http://stackoverflow.com/questions/9142533/plugin-execution-not-covered-by-lifec
ycle-configuration-jbossas-7-ear-archetype

and 

http://wiki.eclipse.org/M2E_plugin_execution_not_covered

Get back to me if you still think this is a plugin error after reading these. 

Cheers
Craig

Original comment by craig...@gmail.com on 16 Mar 2013 at 10:29

GoogleCodeExporter commented 9 years ago
ok for me. Sorry for this report, I should search a little more next time.

Original comment by christin...@gmail.com on 18 Mar 2013 at 2:08

GoogleCodeExporter commented 9 years ago
As of m2e 1.1, the plugin can now bundle the metadata necessary to avoid this 
problem, as per http://wiki.eclipse.org/M2E_compatible_maven_plugins

The plugin just needs to have the below in 
META-INF/m2e/lifecycle-mapping-metadata.xml:

<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <goals>
                    <goal>weave</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <execute/>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

Original comment by rdicr...@lapis.com on 23 May 2013 at 9:44

GoogleCodeExporter commented 9 years ago
Thanks for your answers. May be the last answer can take place in the official 
documentation.

JM.

Original comment by the.jmcnet.team on 24 May 2013 at 5:53

GoogleCodeExporter commented 9 years ago
WARNING! m2e's behavior has changed in 1.3 (see 
http://wiki.eclipse.org/M2E_plugin_execution_not_covered#execute_plugin_goal)

If you have a lifecycle mapping for any plugin and you specify <execute/> for 
the action, m2e 1.2 and earlier default to runOnIncremental = true. m2e 1.3 and 
later default to runOnIncremental = false, so if you just have <execute/> for 
the staticweave plugin and you upgrade m2e, it will stop weaving your entities.

To fix the problem, replace this:
<execute/>
with this:
<execute>
    <runOnIncremental>true</runOnIncremental>
</execute>

The latter will still work with earlier versions of m2e.

Original comment by rdicr...@lapis.com on 12 Jun 2013 at 9:20

GoogleCodeExporter commented 9 years ago
@rdicr...   Where exactly did you configure this.  I was able to do it adding 
the following to my pom.xml, but I am not sure if this was the best option...

<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>au.com.alderaan</groupId>
                                <artifactId>eclipselink-staticweave-maven-plugin</artifactId>
                                <versionRange>[1.0.4,)</versionRange>
                                <goals>
                                    <goal>weave</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <execute>
                                    <runOnIncremental>true</runOnIncremental>
                                    </execute>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

Original comment by nfdavenp...@gmail.com on 17 Jul 2013 at 4:06

GoogleCodeExporter commented 9 years ago
@nfdavenp: I did the same thing. As far as I know, adding the lifecycle mapping 
to your POM is the best option right now.

It would be better if the plugin shipped with the appropriate metadata so this 
isn't necessary. I believe it is also possible to make an Eclipse plugin that 
contains the necessary metadata, but no one has done that as far as I know.

Original comment by rdicr...@lapis.com on 17 Jul 2013 at 1:52