-
1. Re: PackagingType of MavenCoordinates always has JAR value
kpiwko Oct 16, 2013 7:40 AM (in response to xavi.arias.segui)Hi Xavi,
this is expected behavior, pom.xml is used only to get version of the artifact. You are asking resolved to get artifactId:groupId and the default packing in Maven world is JAR. You rather need to specify coordinates in G:A:P:V form.
Please refer to https://github.com/shrinkwrap/resolver documentation, where you can get more details. If you want to still use version defined in pom.xml, you can use following syntax: G:A:P:?, so groupId:artifactId:ejb:? and ? will get replaced by version from pom.xml file.
HTH,
Karel
-
2. Re: PackagingType of MavenCoordinates always has JAR value
xavi.arias.segui Oct 21, 2013 3:12 PM (in response to xavi.arias.segui)Hi Karel,
Thanks for your response, I see the point. My problem is creating an EAR from an EJB module and its dependencies. What seems strange to me is that the EJB dependencies of my EJB module are always JAR, so how can I dynamically know the Packaging type of a module?
Also the file extension of the resolved module using G:A:ejb:V is .ejb, which apparently inhibits Weld to scan CDI beans.
Regards
-
3. Re: PackagingType of MavenCoordinates always has JAR value
kpiwko Oct 24, 2013 9:15 AM (in response to xavi.arias.segui)I haven't tried following workaround but you should be able to resolve module as .ejb, but store it into EAR as .jar.
You can create an utility that would wrap MavenResolvedArtifact , use metadata there to construct .jar name as File and use getAsInputStream() to fill the content of the file. Then you can simply put created file to EAR instead of originally resolved .ejb file.
Karel