Combining dependency with related/required build step

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

Combining dependency with related/required build step

DariusX
We have a JAR that is a dependency for many WARs.  In turn, this JAR has
dependencies on some DB2 JARs.

Any POM using this JAR also needs to copy some DB2-related files to a
place under the target directory. We do this by using maven-resources-plugin

Is there a way to have that build step done "automatically" whenever the
JAR dependency is declared?



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Reply | Threaded
Open this post in threaded view
|

Re: Combining dependency with related/required build step

Anders Hammar
On Fri, Aug 10, 2018 at 11:56 AM DariusGmail <[hidden email]> wrote:

> We have a JAR that is a dependency for many WARs.  In turn, this JAR has
> dependencies on some DB2 JARs.
>
> Any POM using this JAR also needs to copy some DB2-related files to a
> place under the target directory. We do this by using
> maven-resources-plugin
>
> Is there a way to have that build step done "automatically" whenever the
> JAR dependency is declared?
>

No, it's not.

The best way to handle this is to always read resources from the classpath.
So then you just need to contain these DB2-related files in a jar and add
that jar to the classpath (i.e. add a dependency).

/Anders


>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>