Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include older m2e plugins with m2e 1.0+ using life-cycle mapping?

I want to enable older plug ins not available in m2e v 1.0

I have added this to the POM but it does not work if there are multiple items.

    <pluginManagement>
        <plugins>
            <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-dependency-plugin</artifactId>
                                    <version>[0.0.0,)</version>
                                    <goals>
                                        <goal>unpack</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>build-helper-maven-plugin</artifactId>
                                    <version>[0.0.0,)</version>
                                    <phase>generate-sources</phase>
                                    <goals>
                                        <goal>add-source</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

I have also tried the following variation.

    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <lifecycleMappings>
                            <lifecycleMapping>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.apache.maven.plugins</groupId>
                                            <artifactId>maven-dependency-plugin</artifactId>
                                            <version>[0.0.0,)</version>
                                            <goals>
                                                <goal>unpack</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMapping>
                            <lifecycleMapping>
                                <pluginExecutions>
                                    <pluginExecution>
                                        <pluginExecutionFilter>
                                            <groupId>org.codehaus.mojo</groupId>
                                            <artifactId>build-helper-maven-plugin</artifactId>
                                            <version>[0.0.0,)</version>
                                            <phase>generate-sources</phase>
                                            <goals>
                                                <goal>add-source</goal>
                                            </goals>
                                        </pluginExecutionFilter>
                                        <action>
                                            <execute />
                                        </action>
                                    </pluginExecution>
                                </pluginExecutions>
                            </lifecycleMapping>
                        </lifecycleMappings>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

The error message I get is:

Cannot parse lifecycle mapping metadata for maven project MavenProject: com.sakriom:drools-context:0.0.1-SNAPSHOT @ D:\Documents and Settings.....\Workspaces\Eclipse 3.6 - Scala\DroolsContext\pom.xml Cause: Unrecognised tag: 'version' (position: START_TAG seen ...\r\n ... @10:22)

How is this error message decoded?

like image 849
Suminda Sirinath S. Dharmasena Avatar asked Jul 10 '11 14:07

Suminda Sirinath S. Dharmasena


2 Answers

"Cause: Unrecognised tag: 'version'" -- It's complaining about the <version>[0.0.0,)</version> tag because it doesn't belong inside of a <pluginExecutionFilter>. You should use <versionRange>[0.0.0,)</versionRange> instead.

like image 170
Justin Garrick Avatar answered Nov 18 '22 21:11

Justin Garrick


The element version is not allowed at line 8.

If you need more help, add the relevant part of the pom-xml to your question.

[EDIT] Based on the POM you supplied, the problem is that you're using a property in the version element of the project. Maven only supports properties in all other version elements but not this one.

But the error message seems a bit odd. Try the latest Maven release (3.0.3). If that still gives the same error, please create a small demo POM which shows the problem (just delete as much as possible) and open a bug in the Maven issue tracker.

like image 43
Aaron Digulla Avatar answered Nov 18 '22 21:11

Aaron Digulla