Improved Eclipse IDE experience: m2e's maven-dependency-plugin 92/37792/3
authorMichael Vorburger <vorburger@redhat.com>
Tue, 19 Apr 2016 10:07:35 +0000 (12:07 +0200)
committerMichael Vorburger <vorburger@redhat.com>
Thu, 21 Apr 2016 17:51:41 +0000 (17:51 +0000)
It now now longer whines about "Artifact has not been packaged yet. When
used on reactor artifact, unpack should be executed after packaging: see
MDEP-98" nor "Plugin execution not covered by lifecycle
configuration: org.apache.maven.plugins:maven-dependency-plugin
:2.10:unpack (execution: unpack-license, phase: generate-resources)"

Strangely, changing this in odlparent/pom.xml (only) does not work and
leads to an "Error" in Project > Properties > Maven > Lifecycle Mapping,
Copy to Clipboard, and despite M2E offering a Quick Fix to add the
ignore anywhere in the pom.xml hiearchy, it has no effect / causes error
in odlparent - but when added to its parent odlparent-lite then it's OK!
(Or inside the last/leaf pom.xml; but this should be higher up.)

Alternatively it would have been possible to install the m2e connector
for the Maven Dependency Plugin - BUT that only hurts build performance,
and for something as minor as copying a license file around during
build, I don't see the point in-IDE, and so IMHO this one should be
ignore instead of execute.

Change-Id: I3754096209e28fb03ad84db3fe847f0ae776f9d1
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
odlparent-lite/pom.xml
odlparent/pom.xml

index f22232162b1cb729b17c14dbcdf4e6ab2ecbf319..c98101d2c8bce24c778865c359752b8867dc27a8 100644 (file)
             </execution>
           </executions>
         </plugin>
+        <!--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>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <versionRange>[2.10,)</versionRange>
+                    <goals>
+                      <goal>unpack</goal>
+                    </goals>
+                  </pluginExecutionFilter>
+                  <action>
+                    <ignore></ignore>
+                  </action>
+                </pluginExecution>
+              </pluginExecutions>
+            </lifecycleMappingMetadata>
+          </configuration>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>
index cf2893644e841683cfaead0ec5e3a489b28ba91f..6c6966f92134edbd236d5f6b6edb4e73e4773fe8 100644 (file)
                     </goals>
                   </pluginExecutionFilter>
                   <action>
-                    <execute/>
+                    <ignore/>
                   </action>
                 </pluginExecution>
                 <pluginExecution>