Reputation: 2568
I have a project in which there are few components like A, B and C. All the components are exposing rest interfaces that other components are consuming. So, I am using ant to product A.war, A-services.jar, B.war, B-services.jar, C.war, C-services.jar.
A-services.jar contain the interface declarations for B and C. B-services.jar contain the interface declarations for A and C. C-services.jar contain the interface declarations for A and B.
I want to migrate it to Maven. But I have read at some places, it is not a good idea to have a single pom produce multiple packages like A-services.jar and A.war. What should be the best way to go for that.
Upvotes: 4
Views: 9688
Reputation: 5532
You may find the maven-assembly-plugin
to be helpful for you, but as Andrew stated, you really need to separate out your project into proper modules. This is what Maven is really for.
Upvotes: 2
Reputation: 13638
I would assume the reason you have A-services is because of shared data models and such. With that being the case you end up with multiple projects. A POM for the A services. Then another A WAR project that has a dependency on A-services. And your B project also has a dependency on A-services.
With that being said it seems you really just need to separate your projects into data model projects and implementation projects.
You will have six projects. Do not try to make Maven produce a WAR and JAR from the same project.
Upvotes: 4