> 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
> 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).