Reputation: 21
I have one monolith project in Java, and now it doesn't use maven. This project is CLIENT and SERVER project and is a GUI, so there are swing forms.
With the IDE I'm currently using (JDeveloper) I can make one jar for SERVER and one jar for CLIENT.
Now I want to migrate an actual project on maven to use NetBeans IDE I must obtain two jars from the same project, SERVER and CLIENT.
Is there a way to obtain this with some maven plugin?
If there isn't, is there a way to "duplicate" a project in a submodule project to have two jars from one source?
Upvotes: 1
Views: 141
Reputation: 40438
You can make a multi-module maven project.
Configure your monolith code base in the root of the project. Check it compiles via mvn clean install
.
Now add 2 submodules, client
and server
. Have both modules add a dependency to the root maven module.
Then filter out the classes you want to include in client.jar and server.jar via package name filtering using a <build>
filter.
Upvotes: 1