How to share resources across projects in Maven | Sonatype Blog
There are a few ways to share resources across multiple projects or modules:
- Cut and paste them.
- Use Assembly and Dependency plugins
- Use the maven-remote-resources-plugin
In this blog I'll show how to do the second option since in my opinion, it is currently the most stable and flexible. In the future, I'll try out the maven-remote-resources-plugin and write up a tutorial.
The assembly plugin is a bit complicated but it can also be very powerful when you find a few good examples to get you started. I felt it was important enough to understand assembly that I made it a pop-quiz lab for the Maven Training we provide.
At the end of this post is a zip file that contains the files described…so don't worry about copying everything verbatim and focus on the why and how
I'm going to show how this is done in a multi module project, so the first thing we need is the top level parent pom (there's probably an archetype for this but I just grab one from some random project and hack it up):
Read full article from How to share resources across projects in Maven | Sonatype Blog
No comments:
Post a Comment