You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kirin Eugene <ki...@mosinfo.ru> on 2006/04/07 10:57:09 UTC

assembling war?

Hello!
I can not understand how I to add some resources into war archive. I
know that I can put all my resources under main/webapp dir, but in
this dir I must support a real structure of my dir. I mean the next:
Assume I've got a configuration file with log4j.xml name. I hold it
under "PROJECT_HOME/src/main/conf/", so if I want to put my file on the
web server under "PROJECT_HOME/WEB-INF/classes/" dir, then I put
log4j.xml under "PROJECT_HOME/src/main/webapp/WEB-INF/classes/" and
the war plugin will do all right. So can I tell to war plugin to take
my log4j.xml from "PROJECT_HOME/src/main/conf/" and to put into
"EXPLODED_PROJECT/WEB-INF/classes/"?

Thanks for responses!



-- 
С уважением,
 Kirin                          mailto:kirin@mosinfo.ru


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


Re: assembling war?

Posted by Wayne Fay <wa...@gmail.com>.
Here's how I've configured my webapp:

src/main/java/com/xyz/web/servlet/TransmitterServlet.java

src/main/webapp/blah.jsp
src/main/webapp/WEB-INF/web.xml

src/main/resources/log4j.properties
src/main/resources/META-INF/application.xml

Then in pom.xml:
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
  </build>

For me at least, this results in bundling all the various files into
the proper directories when the WAR is created. Just type "mvn
package" to create the WAR and it will be created in target.

Hope this helps.

Wayne

On 4/7/06, Trent Rosenbaum <tr...@gmail.com> wrote:
> Hi there,
>
> Not to sure if you have had much luck.
>
> I think you can place your configuration xml file under the
> src/main/resources folder.  Maven should then copy these to the output
> directory for compiled classes.
> The war plugin should then include this in the war , (exploded or packaged).
>
> I have not done this but you should be able to supply resource filters to
> say what should be included at a project file, for example **/*.xml features
> in the documentation for the project descriptor.
>
> I hope this helps to put you in the right direction.
> The above works with *.properties files when working with struts etc.
>
> Trent
>
>
>
> On 07/04/06, Kirin Eugene <ki...@mosinfo.ru> wrote:
> >
> > Hello!
> > I can not understand how I to add some resources into war archive. I
> > know that I can put all my resources under main/webapp dir, but in
> > this dir I must support a real structure of my dir. I mean the next:
> > Assume I've got a configuration file with log4j.xml name. I hold it
> > under "PROJECT_HOME/src/main/conf/", so if I want to put my file on the
> > web server under "PROJECT_HOME/WEB-INF/classes/" dir, then I put
> > log4j.xml under "PROJECT_HOME/src/main/webapp/WEB-INF/classes/" and
> > the war plugin will do all right. So can I tell to war plugin to take
> > my log4j.xml from "PROJECT_HOME/src/main/conf/" and to put into
> > "EXPLODED_PROJECT/WEB-INF/classes/"?
> >
> > Thanks for responses!
> >
> >
> >
> > --
> > С уважением,
> > Kirin                          mailto:kirin@mosinfo.ru
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: assembling war?

Posted by Trent Rosenbaum <tr...@gmail.com>.
Hi there,

Not to sure if you have had much luck.

I think you can place your configuration xml file under the
src/main/resources folder.  Maven should then copy these to the output
directory for compiled classes.
The war plugin should then include this in the war , (exploded or packaged).

I have not done this but you should be able to supply resource filters to
say what should be included at a project file, for example **/*.xml features
in the documentation for the project descriptor.

I hope this helps to put you in the right direction.
The above works with *.properties files when working with struts etc.

Trent



On 07/04/06, Kirin Eugene <ki...@mosinfo.ru> wrote:
>
> Hello!
> I can not understand how I to add some resources into war archive. I
> know that I can put all my resources under main/webapp dir, but in
> this dir I must support a real structure of my dir. I mean the next:
> Assume I've got a configuration file with log4j.xml name. I hold it
> under "PROJECT_HOME/src/main/conf/", so if I want to put my file on the
> web server under "PROJECT_HOME/WEB-INF/classes/" dir, then I put
> log4j.xml under "PROJECT_HOME/src/main/webapp/WEB-INF/classes/" and
> the war plugin will do all right. So can I tell to war plugin to take
> my log4j.xml from "PROJECT_HOME/src/main/conf/" and to put into
> "EXPLODED_PROJECT/WEB-INF/classes/"?
>
> Thanks for responses!
>
>
>
> --
> С уважением,
> Kirin                          mailto:kirin@mosinfo.ru
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>