1

I have 2 maven modules A and B. Both have java classes in src/main/java and resources in src/main/resources. A depends on B so B is referenced in the A's pom.

It works but actually A depends on B only because A needs some resources from B.

Is there any solution for pulling only resources of B without pulling all the B project ?

Thank you in advance for your help

Thomas MoS
  • 56
  • 4
  • Does this answer your question? [Use a dependency's resources?](https://stackoverflow.com/questions/5292283/use-a-dependencys-resources) – MikaelF Feb 26 '20 at 16:11
  • You could extract the resources A relies on in another project C which would only contain those resources and which would be a dependency of both A and B – Aaron Feb 26 '20 at 16:37

1 Answers1

1

I have successfully used the maven-dependency-plugin for that. You can copy the whole or parts of artifacts with that without the need of depending on that artifact.

Please see this example to get a clue:

https://maven.apache.org/plugins/maven-dependency-plugin/examples/unpacking-artifacts.html

s.fuhrm
  • 438
  • 4
  • 9