开发者

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>
                                <actio开发者_开发百科n>
                                    <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?


"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.


"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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜