Reputation: 33
I need some help with Maven for a Java project.
I have 3 modules:
A (has C as dependency and some other stuff...)
B (has C as dependency and some other stuff...)
C (no dependencies)
I want to export a .jar which contains all the classes and all resources from all 3 modules. The reason why I need this structure is because my C project (call it "core") is my software itself, and A and B are plugin entry points, each one for a different platform. What I want to do is to create a single .jar plugin that is compatible with both platforms. And yes, if I put everything together it works, but I don't want my core project to have access to the platforms.
What I tried to do was to create all of them as submodules in a "empty" maven project and then compile/package the main project. Each one of the modules is compiles and packed, but the main's target is empty.
I also tried to use C as the main project, and A and B as submodules, but it did not work.
Btw, I am using IntelliJ.
Thanks
Upvotes: 0
Views: 205
Reputation: 35805
Define a module D that has A and B as dependencies. Furthermore, add the assembly plugin or shade plugin to D to create a fat jar. Then build the whole multi-module project.
Upvotes: 1