4

The problem: I am generating some files under target/temp that I want to be included in the final bundle wab that is being bundled in the package phase. Here is the code snippet that I am using:

<_wab>src/main/webapp</_wab>

<Include-Resource>
              {maven-resources},
              src/main/webapp/destination=target/temp
</Include-Resource>

I would like the directories generated under target/temp to be included under the destination directory structure. However the above syntax is not including the files under temp anywhere. But the maven-resources are getting included in the root location of the wab.

The documentation is from this page: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html under <Include-Resource> instruction. It says " If a specific resource must be placed into a subdirectory of the bundle jar, then use the assignment form, where the first path is the the destination path (including file name if the resource is a file) and the second path is the resource to copy."

I have checked and the required directories are being generated under target/temp before the package phase where the maven-bundle-plugin is being used. Is there something that I am missing?

I would really appreciate any help with this issue.

Music lover
  • 41
  • 1
  • 3

1 Answers1

0

I believe you mean your destination path to be without src/main/webapp, because that's "relative to the root of the resulting bundle JAR file", and your resource to copy perhaps work better with a slash to indicate it's a directory - try if this works better for you:

<Include-Resource>{maven-resources},destination/=target/temp/</Include-Resource>

I have NOT tried this out, but FYI the following does work for me, although this is for two particular files (whereas you want a directory):

<Include-Resource>{maven-resources},META-INF/git.properties=target/classes/META-INF/git.properties,target/classes/LICENSE</Include-Resource>
vorburger
  • 3,439
  • 32
  • 38