You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jake Meier <ko...@razedworld.com> on 2006/03/26 18:39:09 UTC
Including jsps in war from external dependency
I'm tying to set up a maven project in such a way that I can have a base
set of jsp, css, javascript, etc files located in 1 project and have
them included by various other projects. The goal is to have multiple
war files being built with generally the same jsps, css, etc (without
making copies of the jsp files).
Packaging these web files into a jar archive is easy enough, and I could
obviously list this jar as a dependency for my war projects, but I'd
like these files to be deployed in the resultant war file as war/css,
war/js, etc, instead of the jar file simply being included in my
war/WEB-INF/lib directory.
Is there something out there already that can handle this, or do I need
some custom code/scripting to do the job. Could I approach this with a
custom archetype for the webfiles, so that I can handle it in a custom
way during war file building? Is there some way that I can process the
jar archive during one of the war lifecycle phases so that I can
included the files like they were generated-sources? Is there some
other approach that would help?
Any help or direction would be greatly appreciated.
-Jake
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Including jsps in war from external dependency
Posted by Kevin Galligan <kg...@gmail.com>.
Its built into the war plugin. Instead of packaging your included files as
a jar, package them as a war, and make that a dependency in your project.
We use this extensively in our build.
<dependency>
<groupId>yourgroup</groupId>
<artifactId>commonwar</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
Putting that in your pom.xml will cause the war plugin to include the base
war's files in your project.
You *may* need to get the latest war plugin from svn and build it locally.
I've actually set up a vendor branch in our code for the war plugin because
we had to add several things.
The war plugin does all of its work in the package phase, which means its
tough to insert anything in the process unless its completely before or
after. I added a web.xml merger (most of the code from the codehaus cargo
project), as well as a few company-specific processors.
Long story, but basically, what you want is out there.
On 3/26/06, Jake Meier <ko...@razedworld.com> wrote:
>
> I'm tying to set up a maven project in such a way that I can have a base
> set of jsp, css, javascript, etc files located in 1 project and have
> them included by various other projects. The goal is to have multiple
> war files being built with generally the same jsps, css, etc (without
> making copies of the jsp files).
>
> Packaging these web files into a jar archive is easy enough, and I could
> obviously list this jar as a dependency for my war projects, but I'd
> like these files to be deployed in the resultant war file as war/css,
> war/js, etc, instead of the jar file simply being included in my
> war/WEB-INF/lib directory.
>
> Is there something out there already that can handle this, or do I need
> some custom code/scripting to do the job. Could I approach this with a
> custom archetype for the webfiles, so that I can handle it in a custom
> way during war file building? Is there some way that I can process the
> jar archive during one of the war lifecycle phases so that I can
> included the files like they were generated-sources? Is there some
> other approach that would help?
>
> Any help or direction would be greatly appreciated.
>
> -Jake
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>