You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Cecilia Castillo <ca...@llnl.gov> on 2006/12/12 00:05:15 UTC
struts 2 tutorial and maven question
Hi! I am new to struts, maven etc. I am trying to follow the
bootstrap tutorial for struts 2. I used the Maven Archetype to
create a new application for the tutorial and everything worked fine except...
- when I create the Login-validation.xml in my src/main/java/tutorial
directory (where Login.java is), then use use maven to build a war
file, it will not pick up the Login-validation.xml file and put it in
the target/classes/tutorial directory.
However, if I move the Login-validation.xml file to
src/main/resources/tutorial...then maven does pick up the
Login-validation.xml file and put it in the target/classes/tutorial directory.
Can someone tell me
* where are we supposed to keep the xxx-validation.xml files?
* if they are supposed to be in the same directory as the java action
classes, then what do I need to do to the default pom.xml file to
make maven pick up these files and put them in the appropriate
classes subdirectory?
Thanks,
Cecilia
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: struts 2 tutorial and maven question
Posted by Chong Yoke Ping <ch...@gmail.com>.
Hi,
In your pom.xml, under the resource tag, you need to add the
resource directory "**/*.xml".
Hence your resource tags should have the following:
<resources>
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
Cheers,
Yoke Ping
Cecilia Castillo wrote:
> Hi! I am new to struts, maven etc. I am trying to follow the
> bootstrap tutorial for struts 2. I used the Maven Archetype to create
> a new application for the tutorial and everything worked fine except...
>
> - when I create the Login-validation.xml in my src/main/java/tutorial
> directory (where Login.java is), then use use maven to build a war
> file, it will not pick up the Login-validation.xml file and put it in
> the target/classes/tutorial directory.
>
> However, if I move the Login-validation.xml file to
> src/main/resources/tutorial...then maven does pick up the
> Login-validation.xml file and put it in the target/classes/tutorial
> directory.
>
> Can someone tell me
>
> * where are we supposed to keep the xxx-validation.xml files?
>
> * if they are supposed to be in the same directory as the java action
> classes, then what do I need to do to the default pom.xml file to make
> maven pick up these files and put them in the appropriate classes
> subdirectory?
>
> Thanks,
> Cecilia
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org