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.
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.
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.