You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Brian Burridge <ma...@burridge.net> on 2003/12/04 23:04:39 UTC
Building WARS - a few questions
Currently we do our builds with ANT, but I am attempting to move to
Maven.
During our deploy, depending on the ANT target you have chosen, it
copies files from different directories into the target before building
the WAR.
What do you recommend I do in Maven to accomplish building a WAR with
different included files? I could use Ant to build the target
directories, but that seems temporary. I'd prefer to be 100% Maven.
Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Building WARS - a few questions
Posted by __matthewHawthorne <ma...@phreaker.net>.
I just got this to work myself. If you haven't already, be sure to take
a look at the war plugin's documentation
http://maven.apache.org/reference/plugins/war
Maven's war:webapp goal puts all of the included files into
target/${pom.artifactId}. (or something similar to this). For extra
files, you can write a postGoal for war:webapp in maven.xml that adds
all of your extra files. As far a I could tell, all the war:war goal
does is create the actual war file from this directory.
For dependencies, you can specify which ones you want in the war by
using the war.bundle properties
<dependency>
<groupId/>
<artifactId/>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
Hope this helps!
Brian Burridge wrote:
> Currently we do our builds with ANT, but I am attempting to move to
> Maven.
>
> During our deploy, depending on the ANT target you have chosen, it
> copies files from different directories into the target before building
> the WAR.
>
> What do you recommend I do in Maven to accomplish building a WAR with
> different included files? I could use Ant to build the target
> directories, but that seems temporary. I'd prefer to be 100% Maven.
>
> Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Building WARS - a few questions
Posted by "Charles N. Harvey III" <ch...@alloy.com>.
Brian,
I have just spent the past 3 days converting a bunch of my projects
from Ant to Maven. Its not that tough, you just have to get used to
it.
For starters, there is a "war" target for Maven. Also a "war:webapp".
These bundle up files in:
project-home/src/webapp/
And, it takes anything in:
project-home/src/main/resources/*
and puts it in:
project-name/target/project-name/WEB-INF/classes/
To copy files from completely different places, I created my own
maven.xml, which is in the same directory as project.xml.
Here, you can override war:war, war:webapp, or run certain tasks
before or after they run. So, you create a <postGoal name="war:webapp">
and have it do a few <ant:copy file="" todir=""/> and there you go.
If you want me to send you my file let me know.
It takes a bit of getting used to, but it comes. You could also turn
your maven.xml into a plugin and then you wouldn't need to copy your
maven.xml file into every project.
Charlie
Brian Burridge wrote:
> Currently we do our builds with ANT, but I am attempting to move to
> Maven.
>
> During our deploy, depending on the ANT target you have chosen, it
> copies files from different directories into the target before building
> the WAR.
>
> What do you recommend I do in Maven to accomplish building a WAR with
> different included files? I could use Ant to build the target
> directories, but that seems temporary. I'd prefer to be 100% Maven.
>
> Brian
>
> ---------------------------------------------------------------------
> 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: Building WARS - a few questions
Posted by "John D Taylor (ROE)" <jd...@roe.ac.uk>.
Hi Brian,
One of our team has recently written a set of instructions for this that you
may find useful:
http://wiki.astrogrid.org/bin/view/Astrogrid/MakingWarWithMaven
John
----- Original Message -----
From: "Brian Burridge" <ma...@burridge.net>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Thursday, December 04, 2003 10:04 PM
Subject: Building WARS - a few questions
> Currently we do our builds with ANT, but I am attempting to move to
> Maven.
>
> During our deploy, depending on the ANT target you have chosen, it
> copies files from different directories into the target before building
> the WAR.
>
> What do you recommend I do in Maven to accomplish building a WAR with
> different included files? I could use Ant to build the target
> directories, but that seems temporary. I'd prefer to be 100% Maven.
>
> Brian
>
> ---------------------------------------------------------------------
> 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