How about deploying your common and common-overlay into common folder of your app server? AFAIK most app servers that doesn't support ear deployment will still have the common/shared folder to run components that are accessible from the deployed war files.
--- daniel baktiar http://savinggaia.tritiumapps.com - saving the planet is everyone's business! 2011/2/9 João Ferreira <[email protected]> > Hi > > I will try to explain better my current solution, because i would like to > know if this is the better approach. > > As I referenced my requirement is to generate the multiple WARs and > aggregate the WARs in a EAR. I also like to generate skinny wars, and > include the common, and 3rd party JARs only in the EAR... But also generate > "fat-wars" so the WARs can be deployed separately (for example in an > environment that does not support EAR deployment). > > My project structure is the following: > > project: > -webapp1 > -webapp2 > -webapp3 > -common > -common-overlay > -ear > -fat-overlay > > > The webappX projects all have a dependency to the common project with the > scope "provided". > The common project contains common code and all the 3rd party dependencies. > The common-overlay project contains common files to be applied to the > webapp > projects. > The ear project aggregates the webapp projects and the common project to > generate the desired ear > The fat-overlay is just an overlay to create "fat wars", i.e it has a > dependency to the common project with the scope "compile". When I apply > this > overlay to the webapp projects I end up with "fat-wars" > > As you already guess the m-war-plugin for the webapp project is configured > to generate 2 artifacts: a skinny war, and a fat-war that is equal to the > skinny plus the "fat-overlay" > > Is this the maven way? Is there even a maven way for this? > > Another option that came to my mind was to somehow use the > m-assembly-plugin > to use the skinny wars plus the common project and its transitive > precedences, and generate a zip with the 3 wars but each war was injected > with the common project and its dependencies... > > Hope to hear your suggestion > > João Ferreira > > > > > > No dia 8 de Fevereiro de 2011 11:21, João Ferreira > <[email protected]>escreveu: > > > Hello > > > > I have this project that consists of multiple war modules, and the > > requirement to distributed the artifacts as an ear, but also a collection > of > > single wars so they can be deployed in an environment that does not > support > > ear deployment. The problem is that I am using skinny wars and i would > like > > to inject the common libraries in each war. > > > > My first approach was using the multiple executions of the war plugin > with > > different overlays to generate skinny and fat wars, but i would like to > just > > generate a single artifact per module. I was thinking of creating a new > > module that could inject the common libraries in each war and assembly > the > > wars within a zip for simple distribution. Is this possible? > > > > For some context here is my project structure > > > > Project > > - WebApp1 > > - WebApp2 > > - WebApp3 > > - common > > - ear > > > > Best regards > > > > João Ferreira > > >
