Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [s2] Groovy Actions in Struts 2

Wendy Smoak

2007-02-14

Replies:

On 2/14/07, Mark Menard <mark@(protected):

> I have Spring configured, but when it goes to instantiate the Groovy action
> class from the script it's not on the classpath. My environment:
>
>   * Maven 2 (based off the Struts 2 Archetype)
>   * Jetty plugin
>   * Groovy source files mixed into src/main/java
>
> I know my issue is that the .groovy files are not being copied from
> src/main/java to the target directory. Problem is I'm pretty much a Maven
> novice. In ant I'd just make a task to do it, but I have no idea how to do
> that in Maven.

Put them in src/main/resources and they will be picked up automatically.

If you want them in with your Java sources, then you'll need to tell
Maven about them.

Note that you then have to explictly mention the default of
src/main/resources, in addition to your custom locations. Something
like...

<build>
 ...
 <resources>
   <resource>
    <directory>src/main/resources</directory>
   </resource>
   <resource>
    <directory>src/main/java</directory>
    <includes>
      <include>**/*.groovy</include>
    <includes/>
   </resource>
  </resources>
 ...

--
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.