Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Camel: maven-remote-resources-plugin (goal "process") is ignored by m2e

I am working on a Camel Project. I began with taking a camel example, run "mvn eclipse:eclipse" in the shell and then imported it as a maven project into Eclipse. Unfortunately, I have a warning in the pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.camel</groupId>
        <artifactId>examples</artifactId>
        <version>2.13.0</version>
    </parent>

    <artifactId>CruiserFoodSupply</artifactId>
    <packaging>jar</packaging>
    <name>Cruiser Food Supply</name>
    <description>A process on how food supply on a cruiser works.</description>

    <dependencies>

        <!-- Camel dependencies -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-jms</artifactId>
        </dependency>
        <!-- Mail -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-mail</artifactId>
        </dependency>
        <!-- XStream -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-xstream</artifactId>
        </dependency>
        <!-- Weather -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-weather</artifactId>
        </dependency>
        <!-- Many more dependencies-->

    </dependencies>


    <profiles>
        <profile>
            <id>Example</id>
            <properties>
                <target.main.class>org.apache.camel.example.jmstofile.CamelJmsToFileExample</target.main.class>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <!-- Allows the example to be run via 'mvn compile exec:java' -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>${target.main.class}</mainClass>
                    <includePluginDependencies>false</includePluginDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

Eclipse shows a warning in the line where it says <parent> and the warning is:

maven-remote-resources-plugin (goal "process") is ignored by m2e.

How to get rid of this warning?

like image 314
RemmiDemmiSemmi Avatar asked May 28 '14 10:05

RemmiDemmiSemmi


2 Answers

All this is explained on http://wiki.eclipse.org/M2E_plugin_execution_not_covered. Basically this maven plugin is problematic in the context of eclipse builds.

The message originates from the eclipse default lifecycle mapping, which you can override. I basically copied a snippet from the default lifecycle mapping and removed the <message>...</message> from the <ignore> element

I've got m2e v1.4.0.20130601-0317 (I think that's the one that comes with eclipse 4.3 Kepler) and I had two options: "workspace lifecycle mapping metadata" file or just plugin configuration in the pom.xml.

1. workspace lifecycle mapping metadata

You just create a file <workspace>\.metadata\.plugins\org.eclipse.m2e.core\lifecycle-mapping-metadata.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
    <pluginExecutions>
        <pluginExecution>
            <pluginExecutionFilter>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <versionRange>[1.0,)</versionRange>
                <goals>
                    <goal>process</goal>
                </goals>
            </pluginExecutionFilter>
            <action>
                <ignore>
                </ignore>
            </action>
        </pluginExecution>
    </pluginExecutions>
</lifecycleMappingMetadata>

Then you have go into the Preferences and under Maven/Lifecycle Mappings click on the "Reload workspace lifecycle mappings metadata" button. After that, you must update your maven projects (Maven/Update Project...)

2. pom.xml

Or you can do this directly in the pom.xml, so other developers benefit from it as well:

<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-remote-resources-plugin</artifactId>
                                <versionRange>[1.0,)</versionRange>
                                <goals>
                                    <goal>process</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore>
                                </ignore>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>
like image 196
Nikolai Schreier Avatar answered Nov 15 '22 15:11

Nikolai Schreier


In case, the remote-resources:process is a critical step in your project build, and you don't want to have the goal ignored, you can install the m2e-connector for the maven-remote-resources-plugin and remove any lifecycle mapping metadata which you have added to the pom files.

https://github.com/coderplus/m2e-connector-for-maven-remote-resources-plugin

The connector can also process the remote-resources:bundle goal of the maven-remote-resources-plugin

Disclaimer: I'm the author of the connector ;-)

like image 41
coderplus Avatar answered Nov 15 '22 16:11

coderplus