Lucas Hagen
Lucas Hagen

Reputation: 33

Maven dependencies and export

I need some help with Maven for a Java project.

I have 3 modules:

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

Answers (1)

J Fabian Meier
J Fabian Meier

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

Related Questions