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

I am working on a Camel project. I started with a camel example, ran "mvn eclipse: eclipse" in the shell, and then imported it as a maven project in Eclipse. Unfortunately, I have a warning in 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 <parent> indicated, and a warning:

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

How to get rid of this warning?

+6
source share
2 answers

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

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

I have m2e v1.4.0.20130601-0317 (I think the one that comes with eclipse 4.3 Kepler), and I had two options: "workspace life cycle display metadata file" or just plugin configuration in pom.xml ,

1. workspace life cycle display metadata

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

 <?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 will go to "Settings" and in the Maven / Lifecycle Mappings click the "Update workspace life cycle display metadata" button. After that you should update your maven projects (Maven / Update Project ...)

2. pom.xml

Or you can do it directly in pom.xml, so other developers will also benefit from it:

 <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> 
+2
source

In case remote-resources:process is a critical step in your project build and you do not want the target to be ignored, you can install the m2e connector for maven-remote-resources-plugin and remove any lifecycle mapping metadata that you added to the pom files.

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

The connector can also handle remote resources: the purpose of the maven-remote-resources-plugin package

Disclaimer: I am the author of the connector; -)

+2
source

Source: https://habr.com/ru/post/969949/


All Articles