-
1. Re: How to create EAR with libraries which have same artifactId for different groups without file name clashing?
aslak May 11, 2013 3:17 PM (in response to tjuerge)Interesting problem..
Not any easier way that I can think of.
You could probably simplify the fullMvenArtifactName generation by using cordinate.toCanonicalForm().replaceAll(":", "."), but not much beyond that.
A possible solution could be to add some similar feature as the FileMapping to the Resolver, but it would only work if asArchive is used. Since that's the only time we control the name(from the Resolver side anyway).
-
2. Re: How to create EAR with libraries which have same artifactId for different groups without file name clashing?
tjuerge May 13, 2013 9:51 AM (in response to aslak)Thanks Aslak.
After realizing that SW is able to deploy EARs created by the Maven build I ended up with the following approach:
EnterpriseArchive ear = Maven.resolver().loadPomFromFile("pom.xml").resolve("<groupId>:<artifactId>:ear:?") .withoutTransitivity().asSingle(EnterpriseArchive.class);
Btw. MavenCoordinates.MavenCoordinateParser.parse() is a little picky: If omiting the version number (here "?") the packaging type (here "ear") is used as classifier.
I had to enforce an CoordinateParseException to get the hint regarding the supported format "<groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')".
It would be great to have this hint in the JavaDoc for the parameter "canonicalForm" in "ResolveStage.resolve(String canonicalForm)".
-
3. Re: How to create EAR with libraries which have same artifactId for different groups without file name clashing?
mmatloka May 13, 2013 12:55 PM (in response to tjuerge)Btw. MavenCoordinates.MavenCoordinateParser.parse() is a little picky: If omiting the version number (here "?") the packaging type (here "ear") is used as classifier.
I had to enforce an CoordinateParseException to get the hint regarding the supported format "<groupId>:<artifactId>[:<packagingType>[:<classifier>]]:(<version>|'?')".
It would be great to have this hint in the JavaDoc for the parameter "canonicalForm" in "ResolveStage.resolve(String canonicalForm)".
Thanks for the suggestion. https://issues.jboss.org/browse/SHRINKRES-128