You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by DariusGmail <da...@gmail.com> on 2018/08/10 09:56:04 UTC

Combining dependency with related/required build step

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

Re: Combining dependency with related/required build step

Posted by Anders Hammar <an...@hammar.net>.
On Fri, Aug 10, 2018 at 11:56 AM DariusGmail <da...@gmail.com> 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
>