Problems making maven-bundle-plugin pick up resources from target/classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems making maven-bundle-plugin pick up resources from target/classes

Steinar Bang
Versions: Java 1.8
          maven 3.5.0
          frontend-maven-plugin 1.6
          maven-bundle-plugin 2.5.3

I'm using frontend-maven-plugin to get webpack to put a webpack'd
version of a react.js frontend into target/classes/bundle.js

However, maven-bundle-plugin by default doesn't pick up stuff from
target/classes but only from src/main/resources.

Is there a way to make maven-bundle-plugin pick up resources from
target/classes instead? (like the maven-jar-plugin does)

I've googled and found this, but it didn't seem to have any effect (one
google match was a stackoverflow post from 2012)[1]:
   <Include-Resources>{maven-resources}</Include-Resources>

I've tried this as well, as a shot in the dark, didn't have any effect
either:
   <Include-Resource>{maven-resources}</Include-Resource>

Explicitly including stuff from target/classes both with destination
name and source name[2] doesn't look like something I would like to do.
It doesn't scale, especially if I get a lot of static resources, such as
images.

A hack would be to have webpack drop the bundle.js into
src/main/resources/ and then .gitignore the generated files... but
that's not something I would like to do (but at least I wouldn't have to
specify the resources individually).

Thanks!


- Steinar

References:
 [1] <https://stackoverflow.com/questions/8946254/maven-including-unfiltered-resource-file-in-jar-rather-than-what-is-in-target-cl>
 [2] <https://stackoverflow.com/questions/37403993/how-to-include-resource-file-into-osgi-bundle-from-jar-dependency-with-bnd-maven>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Problems making maven-bundle-plugin pick up resources from target/classes

Steinar Bang
>>>>> Steinar Bang <[hidden email]>:

> Versions: Java 1.8
>  maven 3.5.0
>           frontend-maven-plugin 1.6
>           maven-bundle-plugin 2.5.3

> I'm using frontend-maven-plugin to get webpack to put a webpack'd
> version of a react.js frontend into target/classes/bundle.js

> However, maven-bundle-plugin by default doesn't pick up stuff from
> target/classes but only from src/main/resources.

> Is there a way to make maven-bundle-plugin pick up resources from
> target/classes instead? (like the maven-jar-plugin does)

Clicking through the google matched I found this[1] (from November
2016).

Both of the following works:
     <Include-Resource>{maven-resources},/=target/classes/</Include-Resource>
     <Include-Resource>/=target/classes/</Include-Resource>

Ie. they both include the bundle.js that webpack has put into
target/classes.

I'm going for the last version, ie.
     <Include-Resource>/=target/classes/</Include-Resource>
(target/classes includes all of the stuff in src/main/resources anyway)

References:
[1] <https://stackoverflow.com/a/40720033>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]