Community
Participate
Working Groups
The following configuration doesn't work with M2E-WTP: <plugin> <artifactId>maven-ear-plugin</artifactId> <version>2.9</version> <dependencies> <dependency> <!-- our custom naming scheme is defined here --> <groupId>foo.company.maven.ext</groupId> <artifactId>custom-ear-mapping</artifactId> <version>1.0.0</version> </dependency> </dependencies> <configuration> <!-- Use our custom naming scheme --> <fileNameMapping>foo.company.maven.ext.CustomFileNameMapping</fileNameMapping> </configuration> </plugin> This results in the following error in M2E-WTP: An internal error occurred during: "Updating Maven Project". File name mapping implementation[foo.company.maven.ext.CustomFileNameMapping] was not found foo.company.maven.ext.CustomFileNameMapping cannot be found by org.eclipse.m2e.wtp_1.0.1.20130911-1545 Source code shows that dynamic class lookup is attempted but, for some reason, the class isn't found by the class loader: http://git.eclipse.org/c/m2e-wtp/org.eclipse.m2e.wtp.git/tree/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/FileNameMappingFactory.java?id=cc0322559a59dfafab9a357dfbb2e54ad9e10818 Moreover, should this classloading issue be fixed, the feature would not work since the interface package name don't match with https://maven.apache.org/plugins/maven-ear-plugin/xref/org/apache/maven/plugin/ear/output/FileNameMapping.html vs http://git.eclipse.org/c/m2e-wtp/org.eclipse.m2e.wtp.git/tree/org.eclipse.m2e.wtp/src/org/eclipse/m2e/wtp/namemapping/FileNameMapping.java?id=976c0227993c62c2ff0eb12bb2b002d8425e543c (org.apache.maven.plugin.ear.output != org.eclipse.m2e.wtp.namemapping)
Can you please add a sample custom-ear-mapping plugin + test project reproducing the error? This one is gonna be tricky to fix, as we don't load/depend on the maven-ear-plugin classes directly in Eclipse.
As a workaround, I suggest you use the following approach : ... <properties> <ear.fileNameMapping>foo.company.maven.ext.CustomFileNameMapping</ear.fileNameMapping> </properties> ... <plugin> <artifactId>maven-ear-plugin</artifactId> <version>2.9</version> <dependencies> <dependency> <!-- our custom naming scheme is defined here --> <groupId>foo.company.maven.ext</groupId> <artifactId>custom-ear-mapping</artifactId> <version>1.0.0</version> </dependency> </dependencies> <configuration> <!-- Use our custom naming scheme --> <fileNameMapping>${ear.fileNameMapping}</fileNameMapping> </configuration> </plugin> ... <profiles> <profile> <id>m2e</id> <activation> <property> <name>m2e.version</name> </property> </activation> <properties> <!-- One of standard/full/no-version/no-version-for-ejb --> <ear.fileNameMapping>standard</ear.fileNameMapping> </properties> </profile> </profiles> Basically, all CLI builds will use your custom mapping, and builds inside m2e/eclipse will use an m2e-wtp compatible mapping.
Created attachment 242900 [details] Sample project using custom file mapping strategy + custom file mapping strategy implementation Attached 2 sample projects: - Custom file mapping strategy implementation - EAR project making use of that custom file mapping strategy