We have 12 ear files in our SOA layer, we deploy these EARs individually to JBoss. Increasingly we are having trouble managing the dependencies, and the deployment of all these EAR files.
Each EAR is:
- built using Maven, and the maven-ear-plugin
- contains a webModule for RESTful access like payment-rs/payment
- has an API like payment-api-1.1.9.jar, which is often a dependency to other EARs
- uses maven version numbers like payment-service-1.1.9.ear
Ideally, we could have a single EAR (or some other format) that we could version and certify together. I've tried adding modules to the parent pom, but that just facilitates building all the individual EAR at the same time.
Is there a way to somehow combine these EAR files?
If the answer is no, any ideas on if we are "doing it wrong" with our architecture? Should we combine the projects? Solve the API dependency issues some other way?
To me it sounds like you should go for single ear with multiple web modules. See the official docs: http://maven.apache.org/plugins/maven-ear-plugin/modules.html
As you would still use SOA the web services could communicate between each other via whatever interface defined, just deployment could be simplified dramatically.
Your project
pom.xml
s could look like this:WebModuleA with
pom.xml
like:webModuleB with
pom.xml
like:payment-service with
pom.xml
like:and finally, the earModule that would contain all the web modules:
That should be basically it.
Moreover, if you want to prevent having payment-service packaged in the each
war
webModuleX (to reduce the size of the final ear archive), make sure to go for so called "skinny wars": http://maven.apache.org/plugins/maven-ear-plugin/examples/skinny-wars.htmlFeel free to ask in detail, if some of the suggestions is unclear or inaccurate.