You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gareth Western <ga...@gmail.com> on 2006/04/11 23:42:28 UTC

Specifying the location of web.xml in the POM

Hi,

I'm playing around with an old project in Maven, trying to see how to
upgrade our current build scripts. Unfortunately we do not use the
recommended directory structures, therefore I've specified an alternate
sourceDirectory (<sourceDirectory>src</sourceDirectory>) and outputDirectory
(<outputDirectory>classes</outputDirectory>) in the project's POM. This
particular artifact is a WAR, therefore it needs to include the web.xml from
a directory named "webapp" which is located in the same directory as the
"src" directory. How do I specify this in the POM? Is it a <resource>?

Thanks,

Gareth

Re: Specifying the location of web.xml in the POM

Posted by Wayne Fay <wa...@gmail.com>.
Give this a try:

<build>
<plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webXml>${basedir}/src/webapp/web.xml</webXml>
        </configuration>
      </plugin>

Wayne

On 4/11/06, Gareth Western <ga...@gmail.com> wrote:
> Hi,
>
> I'm playing around with an old project in Maven, trying to see how to
> upgrade our current build scripts. Unfortunately we do not use the
> recommended directory structures, therefore I've specified an alternate
> sourceDirectory (<sourceDirectory>src</sourceDirectory>) and outputDirectory
> (<outputDirectory>classes</outputDirectory>) in the project's POM. This
> particular artifact is a WAR, therefore it needs to include the web.xml from
> a directory named "webapp" which is located in the same directory as the
> "src" directory. How do I specify this in the POM? Is it a <resource>?
>
> Thanks,
>
> Gareth
>
>

Re: Specifying the location of web.xml in the POM

Posted by Simon Kitching <sk...@apache.org>.
On Tue, 2006-04-11 at 22:42 +0100, Gareth Western wrote:
> Hi,
> 
> I'm playing around with an old project in Maven, trying to see how to
> upgrade our current build scripts. Unfortunately we do not use the
> recommended directory structures, therefore I've specified an alternate
> sourceDirectory (<sourceDirectory>src</sourceDirectory>) and outputDirectory
> (<outputDirectory>classes</outputDirectory>) in the project's POM. This
> particular artifact is a WAR, therefore it needs to include the web.xml from
> a directory named "webapp" which is located in the same directory as the
> "src" directory. How do I specify this in the POM? Is it a <resource>?
> 

Perhaps you're looking for the <warSourceDirectory> tag (which should
point to the root dir of the webapp, ie the dir with WEB-INF as a
subdir)?

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

Regards,

Simon


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