Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
maven-bundle-plugin-2.3.5
-
None
-
m2e
Description
Attached patch contains two improvements to Embed-Dependency logic meant to enable better integration with m2e. Although better m2e integration was my primary goal, I do not believe these changes are m2e specific and can useful in other scenarios. Both improvements affect the same DependencyEmbedder.java file, so submitting them as two separate patches was not practical.
When bundle manifest generation is invoked from within m2e workspace, some dependencies can be resolved to workspace projects target/classes folders. Using artifact's file name to generate bundle entry path results in multiple bundles entries with "classes" name. As a solution, generate embedded entry path from org.apache.maven.artifact.Artifact attributes. As a side note, there is probably more room to cleanup entry path calculation, for example, reconcile handling of embedDirectory and embedStripGroup. Also, embedStripVersion also strips artifact classifier, which may or may not be the desired behaviour.
In order to use maven-bundle-plugin projects in PDE launch configurtions (i.e. Run As Eclipse Application and JUnit Plug-in Test), m2e needs to be able to map bundle classpath entries to Maven artifacts that were used to generate the bundle entries. Proposed solution is to introduce new Included-Artifacts bundle manifest attribute. For each embedded bundle entry this attribute will contain information about Maven artifact groupId, artifactId, base version and classifier.
Below is an example of Included-Artifacts that means that bundle entry with path jars/decentxml-1.4-SNAPSHOT.jar was produced from Maven artifact de.pdark:decentxml:1.4-SNAPSHOT.
Included-Artifacts: jars/decentxml-1.4-SNAPSHOT.jar;g="de.pdark";a="decentxml";v="1.4-SNAPSHOT"
I am not sure that Included-Artifacts is the best choice of manifest attribute name and I will be happy to update the patch if there is a better name.
Also note that proposed implementation does not handle inlined artifacts. I do not have a need for this yet and decided to leave it for another patch .