War plugin question
My application uses a war file that is shared by multiple contexts within Tomcat. I'm using the Maven2 War plugin to build the war file. At present the generated class files and the jar files used by the application are put inside the war file's WEB-INF/lib and WEB-INF/classes directories. I would like to be able to decrease the memory footprint by putting these files into Tomcat's shared/lib and shared/classes directories. Does anyone know of a way that this can be done? Thanks, Steve Vangasse
Re: War plugin question
Hi Steve, Look at the provided scope for yours dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html HTH, Rémy 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: My application uses a war file that is shared by multiple contexts within Tomcat. I'm using the Maven2 War plugin to build the war file. At present the generated class files and the jar files used by the application are put inside the war file's WEB-INF/lib and WEB-INF/classes directories. I would like to be able to decrease the memory footprint by putting these files into Tomcat's shared/lib and shared/classes directories. Does anyone know of a way that this can be done? Thanks, Steve Vangasse
RE: War plugin question
I actually have 2 webapps shared across multiple contexts that share a common library. When this library is built I've made an ant plugin that copies the library jar and all it's dependencies to Tomcat's common/lib directory. So I'm already using the provided scope for some jars used by the webapps that are in Tomcat's common/lib. Each webapp then has it's own dependencies (struts, jsf etc.) built straight into it's WEB-INF/lib directory and it's class files to WEB-INF/classes. This works fine but get's tight on memory when more and more contexts are running due to the webapp class loader. I'm really looking for a way to build any compile scoped jars straight into Tomcat's shared/lib along with the generated class files to shared/classes. Something like a "destination directory" setting in the war plugin would do the trick but I couldn't find one. Any ideas? Thanks again, Steve Vangasse -Original Message- From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] Sent: 20 March 2007 09:56 To: Maven Users List Subject: Re: War plugin question Hi Steve, Look at the provided scope for yours dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html HTH, Rémy 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > My application uses a war file that is shared by multiple contexts > within Tomcat. I'm using the Maven2 War plugin to build the war file. > At present the generated class files and the jar files used by the > application are put inside the war file's WEB-INF/lib and > WEB-INF/classes directories. I would like to be able to decrease the > memory footprint by putting these files into Tomcat's shared/lib and > shared/classes directories. Does anyone know of a way that this can be > done? > > Thanks, > > Steve Vangasse > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: War plugin question
Re-design your applications so that common classes are in a jar, and include the jars your want to share in your war with scope provided. Then, use the assembly plugin to deploy the provided jars to shared/lib. We use a similar approach and it works well. Kalle On 3/20/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: I actually have 2 webapps shared across multiple contexts that share a common library. When this library is built I've made an ant plugin that copies the library jar and all it's dependencies to Tomcat's common/lib directory. So I'm already using the provided scope for some jars used by the webapps that are in Tomcat's common/lib. Each webapp then has it's own dependencies (struts, jsf etc.) built straight into it's WEB-INF/lib directory and it's class files to WEB-INF/classes. This works fine but get's tight on memory when more and more contexts are running due to the webapp class loader. I'm really looking for a way to build any compile scoped jars straight into Tomcat's shared/lib along with the generated class files to shared/classes. Something like a "destination directory" setting in the war plugin would do the trick but I couldn't find one. Any ideas? Thanks again, Steve Vangasse -Original Message- From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] Sent: 20 March 2007 09:56 To: Maven Users List Subject: Re: War plugin question Hi Steve, Look at the provided scope for yours dependencies. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html HTH, Rémy 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > My application uses a war file that is shared by multiple contexts > within Tomcat. I'm using the Maven2 War plugin to build the war file. > At present the generated class files and the jar files used by the > application are put inside the war file's WEB-INF/lib and > WEB-INF/classes directories. I would like to be able to decrease the > memory footprint by putting these files into Tomcat's shared/lib and > shared/classes directories. Does anyone know of a way that this can be > done? > > Thanks, > > Steve Vangasse > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: War plugin question
Thanks Kalle. That looks like it should solve the problem. Steve Vangasse -Original Message- From: Kalle Korhonen [mailto:[EMAIL PROTECTED] Sent: 20 March 2007 20:10 To: Maven Users List Subject: Re: War plugin question Re-design your applications so that common classes are in a jar, and include the jars your want to share in your war with scope provided. Then, use the assembly plugin to deploy the provided jars to shared/lib. We use a similar approach and it works well. Kalle On 3/20/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: > > I actually have 2 webapps shared across multiple contexts that share a > common library. When this library is built I've made an ant plugin > that copies the library jar and all it's dependencies to Tomcat's > common/lib directory. So I'm already using the provided scope for some > jars used by the webapps that are in Tomcat's common/lib. > > Each webapp then has it's own dependencies (struts, jsf etc.) built > straight into it's WEB-INF/lib directory and it's class files to > WEB-INF/classes. This works fine but get's tight on memory when more > and more contexts are running due to the webapp class loader. > > I'm really looking for a way to build any compile scoped jars straight > into Tomcat's shared/lib along with the generated class files to > shared/classes. > > Something like a "destination directory" setting in the war plugin > would do the trick but I couldn't find one. Any ideas? > > Thanks again, > > Steve Vangasse > > > > -Original Message- > From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] > Sent: 20 March 2007 09:56 > To: Maven Users List > Subject: Re: War plugin question > > Hi Steve, > > Look at the provided scope for yours dependencies. > > http://maven.apache.org/guides/introduction/introduction-to-dependency > -mechanism.html > > HTH, > > Rémy > > > 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > > > My application uses a war file that is shared by multiple contexts > > within Tomcat. I'm using the Maven2 War plugin to build the war file. > > At present the generated class files and the jar files used by the > > application are put inside the war file's WEB-INF/lib and > > WEB-INF/classes directories. I would like to be able to decrease the > > memory footprint by putting these files into Tomcat's shared/lib and > > shared/classes directories. Does anyone know of a way that this can > > be done? > > > > Thanks, > > > > Steve Vangasse > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: War plugin question
The assembly plugin certainly seems to be the solution. My project is multi module; a module for each webapp and a module for the shared library. I've been trying to write an assembly descriptor in the parent module that copies all the jar files from each webapp module (that would normally get copied into WEB-INF/lib) into a directory (I use warSourceExcludes to stop the jars going to WEB-INF/lib). The examples on the maven site don't seem to cover this kind of situation - has anyone attempted anything like this? Thanks, Steve -Original Message- From: Kalle Korhonen [mailto:[EMAIL PROTECTED] Sent: 20 March 2007 20:10 To: Maven Users List Subject: Re: War plugin question Re-design your applications so that common classes are in a jar, and include the jars your want to share in your war with scope provided. Then, use the assembly plugin to deploy the provided jars to shared/lib. We use a similar approach and it works well. Kalle On 3/20/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: > > I actually have 2 webapps shared across multiple contexts that share a > common library. When this library is built I've made an ant plugin > that copies the library jar and all it's dependencies to Tomcat's > common/lib directory. So I'm already using the provided scope for some > jars used by the webapps that are in Tomcat's common/lib. > > Each webapp then has it's own dependencies (struts, jsf etc.) built > straight into it's WEB-INF/lib directory and it's class files to > WEB-INF/classes. This works fine but get's tight on memory when more > and more contexts are running due to the webapp class loader. > > I'm really looking for a way to build any compile scoped jars straight > into Tomcat's shared/lib along with the generated class files to > shared/classes. > > Something like a "destination directory" setting in the war plugin > would do the trick but I couldn't find one. Any ideas? > > Thanks again, > > Steve > > > > -Original Message- > From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] > Sent: 20 March 2007 09:56 > To: Maven Users List > Subject: Re: War plugin question > > Hi Steve, > > Look at the provided scope for yours dependencies. > > http://maven.apache.org/guides/introduction/introduction-to-dependency > -mechanism.html > > HTH, > > Rémy > > > 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > > > My application uses a war file that is shared by multiple contexts > > within Tomcat. I'm using the Maven2 War plugin to build the war file. > > At present the generated class files and the jar files used by the > > application are put inside the war file's WEB-INF/lib and > > WEB-INF/classes directories. I would like to be able to decrease the > > memory footprint by putting these files into Tomcat's shared/lib and > > shared/classes directories. Does anyone know of a way that this can > > be done? > > > > Thanks, > > > > Steve > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: War plugin question
Any reason you're not just packaging it all up in an EAR? Wayne On 3/23/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: The assembly plugin certainly seems to be the solution. My project is multi module; a module for each webapp and a module for the shared library. I've been trying to write an assembly descriptor in the parent module that copies all the jar files from each webapp module (that would normally get copied into WEB-INF/lib) into a directory (I use warSourceExcludes to stop the jars going to WEB-INF/lib). The examples on the maven site don't seem to cover this kind of situation - has anyone attempted anything like this? Thanks, Steve -Original Message- From: Kalle Korhonen [mailto:[EMAIL PROTECTED] Sent: 20 March 2007 20:10 To: Maven Users List Subject: Re: War plugin question Re-design your applications so that common classes are in a jar, and include the jars your want to share in your war with scope provided. Then, use the assembly plugin to deploy the provided jars to shared/lib. We use a similar approach and it works well. Kalle On 3/20/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: > > I actually have 2 webapps shared across multiple contexts that share a > common library. When this library is built I've made an ant plugin > that copies the library jar and all it's dependencies to Tomcat's > common/lib directory. So I'm already using the provided scope for some > jars used by the webapps that are in Tomcat's common/lib. > > Each webapp then has it's own dependencies (struts, jsf etc.) built > straight into it's WEB-INF/lib directory and it's class files to > WEB-INF/classes. This works fine but get's tight on memory when more > and more contexts are running due to the webapp class loader. > > I'm really looking for a way to build any compile scoped jars straight > into Tomcat's shared/lib along with the generated class files to > shared/classes. > > Something like a "destination directory" setting in the war plugin > would do the trick but I couldn't find one. Any ideas? > > Thanks again, > > Steve > > > > -Original Message- > From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] > Sent: 20 March 2007 09:56 > To: Maven Users List > Subject: Re: War plugin question > > Hi Steve, > > Look at the provided scope for yours dependencies. > > http://maven.apache.org/guides/introduction/introduction-to-dependency > -mechanism.html > > HTH, > > Rémy > > > 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > > > My application uses a war file that is shared by multiple contexts > > within Tomcat. I'm using the Maven2 War plugin to build the war file. > > At present the generated class files and the jar files used by the > > application are put inside the war file's WEB-INF/lib and > > WEB-INF/classes directories. I would like to be able to decrease the > > memory footprint by putting these files into Tomcat's shared/lib and > > shared/classes directories. Does anyone know of a way that this can > > be done? > > > > Thanks, > > > > Steve > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: War plugin question
I'm using Tomcat 5.5 which doesn't support EAR files. I think a move to a J2EE application server might be a good idea for the future but in the short term I'm going to use Tomcat. Steve Vangasse www.boardshop.co.uk 0870 0600 688 -Original Message- From: Wayne Fay [mailto:[EMAIL PROTECTED] Sent: 24 March 2007 00:15 To: Maven Users List Subject: Re: War plugin question Any reason you're not just packaging it all up in an EAR? Wayne On 3/23/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: > The assembly plugin certainly seems to be the solution. > > My project is multi module; a module for each webapp and a module for the > shared library. I've been trying to write an assembly descriptor in the > parent module that copies all the jar files from each webapp module (that > would normally get copied into WEB-INF/lib) into a directory (I use > warSourceExcludes to stop the jars going to WEB-INF/lib). The examples on the > maven site don't seem to cover this kind of situation - has anyone attempted > anything like this? > > Thanks, > > Steve > > > -Original Message- > From: Kalle Korhonen [mailto:[EMAIL PROTECTED] > Sent: 20 March 2007 20:10 > To: Maven Users List > Subject: Re: War plugin question > > Re-design your applications so that common classes are in a jar, and include > the jars your want to share in your war with scope provided. Then, use the > assembly plugin to deploy the provided jars to shared/lib. We use a similar > approach and it works well. > > Kalle > > > On 3/20/07, Steve Vangasse <[EMAIL PROTECTED]> wrote: > > > > I actually have 2 webapps shared across multiple contexts that share > > a common library. When this library is built I've made an ant plugin > > that copies the library jar and all it's dependencies to Tomcat's > > common/lib directory. So I'm already using the provided scope for > > some jars used by the webapps that are in Tomcat's common/lib. > > > > Each webapp then has it's own dependencies (struts, jsf etc.) built > > straight into it's WEB-INF/lib directory and it's class files to > > WEB-INF/classes. This works fine but get's tight on memory when more > > and more contexts are running due to the webapp class loader. > > > > I'm really looking for a way to build any compile scoped jars > > straight into Tomcat's shared/lib along with the generated class > > files to shared/classes. > > > > Something like a "destination directory" setting in the war plugin > > would do the trick but I couldn't find one. Any ideas? > > > > Thanks again, > > > > Steve > > > > > > > > -Original Message- > > From: Rémy Sanlaville [mailto:[EMAIL PROTECTED] > > Sent: 20 March 2007 09:56 > > To: Maven Users List > > Subject: Re: War plugin question > > > > Hi Steve, > > > > Look at the provided scope for yours dependencies. > > > > http://maven.apache.org/guides/introduction/introduction-to-dependen > > cy > > -mechanism.html > > > > HTH, > > > > Rémy > > > > > > 2007/3/20, Steve Vangasse <[EMAIL PROTECTED]>: > > > > > > My application uses a war file that is shared by multiple contexts > > > within Tomcat. I'm using the Maven2 War plugin to build the war file. > > > At present the generated class files and the jar files used by the > > > application are put inside the war file's WEB-INF/lib and > > > WEB-INF/classes directories. I would like to be able to decrease > > > the memory footprint by putting these files into Tomcat's > > > shared/lib and shared/classes directories. Does anyone know of a > > > way that this can be done? > > > > > > Thanks, > > > > > > Steve > > > > > > > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
A maven-war-plugin question
Hi all. How can I add a 'jar' module as a dependency to a 'war' module so: * 'jar' module is included in the WEB-INF/lib * but 'war' module sources should not see 'jar' module classes (e.g. autocompletion feature in an IDE doesn't work)? Thank you for your time. -- Alexander Semenov - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
A maven-war-plugin question
I'm using maven-war-plugin in my pom. Here is my code org.apache.maven.plugins maven-war-plugin 2.1-beta-1 target/${webapp.name} src/main/resources/META-INF/ META-INF src/main/resources/META-INF/ My questions is, I need the files under META-INF to show up under target//META-INF/, which the above code accomplishes. But since the plugin constructs its own folder structure, it puts those files under target//WEB-INF/classes/META-INF/ as well. How can I get the files to be excluded from classes/META-INF/ folder and only make them show up under target//META-INF? -- View this message in context: http://maven.40175.n5.nabble.com/A-maven-war-plugin-question-tp4411244p4411244.html Sent from the Maven - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: A maven-war-plugin question
Sorry, I meant 'runtime' of course. On Mon, 2009-04-06 at 23:50 +0300, Alexander Semenov wrote: > Oh, it looks like adding import to the dependency is what > I need. > > On Mon, 2009-04-06 at 23:38 +0300, Alexander Semenov wrote: > > Hi all. > > > > How can I add a 'jar' module as a dependency to a 'war' module so: > > * 'jar' module is included in the WEB-INF/lib > > * but 'war' module sources should not see 'jar' module classes (e.g. > > autocompletion feature in an IDE doesn't work)? > > > > Thank you for your time. -- Alexander Semenov - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: A maven-war-plugin question
Oh, it looks like adding import to the dependency is what I need. On Mon, 2009-04-06 at 23:38 +0300, Alexander Semenov wrote: > Hi all. > > How can I add a 'jar' module as a dependency to a 'war' module so: > * 'jar' module is included in the WEB-INF/lib > * but 'war' module sources should not see 'jar' module classes (e.g. > autocompletion feature in an IDE doesn't work)? > > Thank you for your time. -- Kind regards, Alexander Semenov Java Developer AT Software phone: +375-212-359063 cell: +375-29-2959257 e-mail: aseme...@at-software.com skype: artezio_asemenov_1 AT Software is the result of merge of Artezio and Lanit-Tercom companies. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: A maven-war-plugin question
Put the META-INF folder structure in src/main/webapp. Not in src/main/resources. You should then be able to remove all your special configuration, which is a clear sign of being on the right track. /Anders On Fri, May 20, 2011 at 02:02, dpaily wrote: > I'm using maven-war-plugin in my pom. Here is my code > >org.apache.maven.plugins >maven-war-plugin >2.1-beta-1 > >target/${webapp.name > } > > > > src/main/resources/META-INF/ >META-INF > > > > src/main/resources/META-INF/ > > > > > My questions is, I need the files under META-INF to show up under > target//META-INF/, which the above code accomplishes. But > since the plugin constructs its own folder structure, it puts those files > under target//WEB-INF/classes/META-INF/ as well. How can I > get > the files to be excluded from classes/META-INF/ folder and only make them > show up under target//META-INF? > > -- > View this message in context: > http://maven.40175.n5.nabble.com/A-maven-war-plugin-question-tp4411244p4411244.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > >
Re: A maven-war-plugin question
I think your real question might be, who is putting this stuff in my WEB-INF/classes dir? It is the resources plugin, as commanded by the war-plugin. therefore, you would add a element to prevent this. Below is a trivial example. /r == src src/main/resources/META-INF/foo.xml == target target/foo-1.0.war target/foo/META-INF/foo.xml target/war/work/webapp-cache.xml == war contents META-INF/ META-INF/MANIFEST.MF WEB-INF/ META-INF/foo.xml == pom.xml 4.0.0 com.foo foo war 1.0 ${project.build.sourceDirectory} maven-war-plugin 2.1-beta-1 false target/${webapp.name} WEB-INF/classes/** src/main/resources/META-INF/ META-INF false foo At 5:02 PM -0700 5/19/11, dpaily wrote: >I'm using maven-war-plugin in my pom. Here is my code > >org.apache.maven.plugins >maven-war-plugin >2.1-beta-1 > >target/${webapp.name} > > > > src/main/resources/META-INF/ > META-INF > > > > >src/main/resources/META-INF/ > > > > >My questions is, I need the files under META-INF to show up under >target//META-INF/, which the above code accomplishes. But >since the plugin constructs its own folder structure, it puts those files >under target//WEB-INF/classes/META-INF/ as well. How can I get >the files to be excluded from classes/META-INF/ folder and only make them >show up under target//META-INF? > >-- >View this message in context: >http://maven.40175.n5.nabble.com/A-maven-war-plugin-question-tp4411244p4411244.html >Sent from the Maven - Users mailing list archive at Nabble.com. > >- >To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org