Felix Meschberger (JIRA) wrote:
[ http://issues.apache.org/jira/browse/FELIXM2-10?page=comments#action_12447696 ] Felix Meschberger commented on FELIXM2-10:
------------------------------------------

I think the Include-Resource of the bnd tool is very valuable to include 
additional stuff. For the plugin I would suggest to stay with the default Maven 
handling of resources, as this is how the casual Maven user expects things to 
happen: Everyhing from the resources folder (configured as the 
pom.build.resources) is copied into the ${pom.build.outputdirectory} according 
to the path. Generally the Java classes will probably depend on this.

Consequenly, I would suggest the Include-Resource header not to default to 
/src/main/resources. The drawback is of course, that developers will have to 
take care to include the resources through Export-Package or Private-Package. 
The Include-Resource header might then be used for stuff like license files, 
readme files or things, which are not handled by maven but still must be 
included.

I think it is better to include src/main/resources/ by default because it will at least appear to give the same behavior as the default maven behavior. Without this, the user will see that resources are getting copied to the target/classes/ directory, but they are not getting copied into the resulting JAR file and this might be confusing, but is the way that it works since the plugin won't happen to see the resources unless they just happen to fall into a package that is either listed as exported or private.

By including it, all resources will be copied into the resulting JAR file as expected. Perhaps what we need to do is have the plugin automatically convert any resources listed in the POM to the Include-Resource instruction, as you basically suggested...

-> richard

maven-bundle-plugin: Failures if src or parts of it are missing
---------------------------------------------------------------

                Key: FELIXM2-10
                URL: http://issues.apache.org/jira/browse/FELIXM2-10
            Project: Felix M2 Plugin
         Issue Type: Bug
           Reporter: Felix Meschberger
        Assigned To: Richard S. Hall
        Attachments: FELIXM2-10.diff


When using the maven-bundle-plugin to build bundles from existing jar files, 
three issues exist:
   * If nothing is copied into the project output directory (target/classes), the folder does not 
exist and the BundlePlugin.getClassPath fails for the line "new Jar(".", 
outputDirectory)"
   * If no resources exist, an exception is logged for the missing 
src/main/resources folder. I suggest to only place a default Include-Resources 
header if the src/main/resources folder exists.
   * If no maven build phase generates output the target folder does not exist 
at the time the BundlePluing.execute method tries to write the JAR File.
I will attach a patch for the three issues.

Reply via email to