You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Doug Tanner <do...@benefitfocus.com> on 2007/04/03 16:58:33 UTC

Include Common JSPs in multiple wars

How do you include commons JSPs in multiple wars?  We have a common
module that produces a jar instead of a war, but I need to include all
the JSPs in this module in all my other webapps.  I tried using the
<resource> tag, but that places the files in WEB-INF/classes.  Is there
another tag that I am missing from the documentation?

 

Thanks,

 

Doug Tanner

Configuration Management Engineer

Benefitfocus.com, Inc.



****************************************************************************************
BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is intended only for the individual or entity to which it is addressed and may contain information that is confidential and protected by law. Unauthorized review, use, disclosure, or dissemination of this communication or its contents in any way is prohibited and may be unlawful. If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please notify the original sender immediately by e-mail or telephone, return the original message to the original sender or to bfpostmaster@benefitfocus.com, and destroy all copies or derivations of the original message. Thank you.  (BFeComNote Rev. 08/01/2005)
***************************************************************************************

Re: Include Common JSPs in multiple wars

Posted by Mark Hobson <ma...@gmail.com>.
A war overlay would be the cleanest solution:

http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html

Mark

On 03/04/07, Doug Tanner <do...@benefitfocus.com> wrote:
> Problem solved.
>
> Solution:
>
>   <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-war-plugin</artifactId>
>     <version>2.0</version>
>     <configuration>
>       <webResources>
>         <resource>
>           <!-- this is relative to the pom.xml directory -->
>           <directory>../common/src/main/webapp</directory>
>         </resource>
>       </webResources>
>     </configuration>
>   </plugin>
>
> Doug Tanner
>
>
> > -----Original Message-----
> > From: Doug Tanner [mailto:doug.tanner@benefitfocus.com]
> > Sent: Tuesday, April 03, 2007 1:00 PM
> > To: Maven Users List
> > Subject: RE: Include Common JSPs in multiple wars
> >
> > Directory Structure:
> >
> > Webapps
> >   -common
> >     -src
> >       -main
> >         -webapp
> >           -[Bunch of JSPs]
> >     -pom.xml
> >   -module1
> >     -src
> >       -main
> >         -java
> >         -webapp
> >           -[Bunch of JSPs]
> >     -pom.xml
> >   -module2
> >     -src
> >       -main
> >         -java
> >         -webapp
> >           -[Bunch of JSPs]
> >     -pom.xml
> >
> > How do I include the JSPs from the common module in module1.war and
> > module2.war?
> >
> > Doug Tanner
> >
> >
> > > -----Original Message-----
> > > From: Tomasz Pik [mailto:tompik@gmail.com]
> > > Sent: Tuesday, April 03, 2007 12:24 PM
> > > To: Maven Users List
> > > Subject: Re: Include Common JSPs in multiple wars
> > >
> > > On 4/3/07, Doug Tanner <do...@benefitfocus.com> wrote:
> > > > How do you include commons JSPs in multiple wars?  We have a
> common
> > > > module that produces a jar instead of a war, but I need to include
> > all
> > > > the JSPs in this module in all my other webapps.  I tried using
> the
> > > > <resource> tag, but that places the files in WEB-INF/classes.  Is
> > there
> > > > another tag that I am missing from the documentation?
> > >
> > > There's no way to 'pass' those jsp to your 'war' projects from
> within
> > > 'jar' project (at least I do not know such a way).
> > > But you may change packaging of your 'shared' project from 'jar'
> > > to 'war'. Then this 'shared' war will contain all required jsp files
> > > and compiled classes, under WEB-INF/classes.
> > > Then, for your 'war' projects maven will include all of this (both
> > > classes and jsp files) in created war and that will be, what are
> > > you looking for,
> > >
> > > HTH,
> > > Tomek
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
> >
> ************************************************************************
> **
> > **************
> > BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is
> > intended only for the individual or entity to which it is addressed
> and
> > may contain information that is confidential and protected by law.
> > Unauthorized review, use, disclosure, or dissemination of this
> > communication or its contents in any way is prohibited and may be
> > unlawful. If you are not the intended recipient or a person
> responsible
> > for delivering this message to an intended recipient, please notify
> the
> > original sender immediately by e-mail or telephone, return the
> original
> > message to the original sender or to bfpostmaster@benefitfocus.com,
> and
> > destroy all copies or derivations of the original message. Thank you.
> > (BFeComNote Rev. 08/01/2005)
> >
> ************************************************************************
> **
> > *************
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
>
>
>
> ****************************************************************************************
> BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is intended only for the individual or entity to which it is addressed and may contain information that is confidential and protected by law. Unauthorized review, use, disclosure, or dissemination of this communication or its contents in any way is prohibited and may be unlawful. If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please notify the original sender immediately by e-mail or telephone, return the original message to the original sender or to bfpostmaster@benefitfocus.com, and destroy all copies or derivations of the original message. Thank you.  (BFeComNote Rev. 08/01/2005)
> ***************************************************************************************
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Include Common JSPs in multiple wars

Posted by Doug Tanner <do...@benefitfocus.com>.
Problem solved.

Solution:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.0</version>
    <configuration>
      <webResources>
        <resource>
          <!-- this is relative to the pom.xml directory -->
          <directory>../common/src/main/webapp</directory>
        </resource>
      </webResources>
    </configuration>
  </plugin>

Doug Tanner
 

> -----Original Message-----
> From: Doug Tanner [mailto:doug.tanner@benefitfocus.com]
> Sent: Tuesday, April 03, 2007 1:00 PM
> To: Maven Users List
> Subject: RE: Include Common JSPs in multiple wars
> 
> Directory Structure:
> 
> Webapps
>   -common
>     -src
>       -main
>         -webapp
>           -[Bunch of JSPs]
>     -pom.xml
>   -module1
>     -src
>       -main
>         -java
>         -webapp
>           -[Bunch of JSPs]
>     -pom.xml
>   -module2
>     -src
>       -main
>         -java
>         -webapp
>           -[Bunch of JSPs]
>     -pom.xml
> 
> How do I include the JSPs from the common module in module1.war and
> module2.war?
> 
> Doug Tanner
> 
> 
> > -----Original Message-----
> > From: Tomasz Pik [mailto:tompik@gmail.com]
> > Sent: Tuesday, April 03, 2007 12:24 PM
> > To: Maven Users List
> > Subject: Re: Include Common JSPs in multiple wars
> >
> > On 4/3/07, Doug Tanner <do...@benefitfocus.com> wrote:
> > > How do you include commons JSPs in multiple wars?  We have a
common
> > > module that produces a jar instead of a war, but I need to include
> all
> > > the JSPs in this module in all my other webapps.  I tried using
the
> > > <resource> tag, but that places the files in WEB-INF/classes.  Is
> there
> > > another tag that I am missing from the documentation?
> >
> > There's no way to 'pass' those jsp to your 'war' projects from
within
> > 'jar' project (at least I do not know such a way).
> > But you may change packaging of your 'shared' project from 'jar'
> > to 'war'. Then this 'shared' war will contain all required jsp files
> > and compiled classes, under WEB-INF/classes.
> > Then, for your 'war' projects maven will include all of this (both
> > classes and jsp files) in created war and that will be, what are
> > you looking for,
> >
> > HTH,
> > Tomek
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 
>
************************************************************************
**
> **************
> BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is
> intended only for the individual or entity to which it is addressed
and
> may contain information that is confidential and protected by law.
> Unauthorized review, use, disclosure, or dissemination of this
> communication or its contents in any way is prohibited and may be
> unlawful. If you are not the intended recipient or a person
responsible
> for delivering this message to an intended recipient, please notify
the
> original sender immediately by e-mail or telephone, return the
original
> message to the original sender or to bfpostmaster@benefitfocus.com,
and
> destroy all copies or derivations of the original message. Thank you.
> (BFeComNote Rev. 08/01/2005)
>
************************************************************************
**
> *************
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



****************************************************************************************
BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is intended only for the individual or entity to which it is addressed and may contain information that is confidential and protected by law. Unauthorized review, use, disclosure, or dissemination of this communication or its contents in any way is prohibited and may be unlawful. If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please notify the original sender immediately by e-mail or telephone, return the original message to the original sender or to bfpostmaster@benefitfocus.com, and destroy all copies or derivations of the original message. Thank you.  (BFeComNote Rev. 08/01/2005)
***************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Include Common JSPs in multiple wars

Posted by Doug Tanner <do...@benefitfocus.com>.
Directory Structure:

Webapps
  -common
    -src
      -main
        -webapp
          -[Bunch of JSPs]
    -pom.xml
  -module1
    -src
      -main
        -java
        -webapp
          -[Bunch of JSPs]
    -pom.xml
  -module2
    -src
      -main
        -java
        -webapp
          -[Bunch of JSPs]
    -pom.xml

How do I include the JSPs from the common module in module1.war and
module2.war?

Doug Tanner
 

> -----Original Message-----
> From: Tomasz Pik [mailto:tompik@gmail.com]
> Sent: Tuesday, April 03, 2007 12:24 PM
> To: Maven Users List
> Subject: Re: Include Common JSPs in multiple wars
> 
> On 4/3/07, Doug Tanner <do...@benefitfocus.com> wrote:
> > How do you include commons JSPs in multiple wars?  We have a common
> > module that produces a jar instead of a war, but I need to include
all
> > the JSPs in this module in all my other webapps.  I tried using the
> > <resource> tag, but that places the files in WEB-INF/classes.  Is
there
> > another tag that I am missing from the documentation?
> 
> There's no way to 'pass' those jsp to your 'war' projects from within
> 'jar' project (at least I do not know such a way).
> But you may change packaging of your 'shared' project from 'jar'
> to 'war'. Then this 'shared' war will contain all required jsp files
> and compiled classes, under WEB-INF/classes.
> Then, for your 'war' projects maven will include all of this (both
> classes and jsp files) in created war and that will be, what are
> you looking for,
> 
> HTH,
> Tomek
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



****************************************************************************************
BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is intended only for the individual or entity to which it is addressed and may contain information that is confidential and protected by law. Unauthorized review, use, disclosure, or dissemination of this communication or its contents in any way is prohibited and may be unlawful. If you are not the intended recipient or a person responsible for delivering this message to an intended recipient, please notify the original sender immediately by e-mail or telephone, return the original message to the original sender or to bfpostmaster@benefitfocus.com, and destroy all copies or derivations of the original message. Thank you.  (BFeComNote Rev. 08/01/2005)
***************************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Include Common JSPs in multiple wars

Posted by Tomasz Pik <to...@gmail.com>.
On 4/3/07, Doug Tanner <do...@benefitfocus.com> wrote:
> How do you include commons JSPs in multiple wars?  We have a common
> module that produces a jar instead of a war, but I need to include all
> the JSPs in this module in all my other webapps.  I tried using the
> <resource> tag, but that places the files in WEB-INF/classes.  Is there
> another tag that I am missing from the documentation?

There's no way to 'pass' those jsp to your 'war' projects from within
'jar' project (at least I do not know such a way).
But you may change packaging of your 'shared' project from 'jar'
to 'war'. Then this 'shared' war will contain all required jsp files
and compiled classes, under WEB-INF/classes.
Then, for your 'war' projects maven will include all of this (both
classes and jsp files) in created war and that will be, what are
you looking for,

HTH,
Tomek

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org