views:

52

answers:

1

Hi,

We are working with Maven and Hudson for unit testing and war building. Copying sources (java and resources) to WEB-INF/src is required by our customer.

There is a simple way to do this with maven?

Thank you in advance.

+3  A: 

This should be possible by declaring the src/main/java and src/main/resources as additional Web Resource directories in the Maven War Plugin configuration. Inspired by the Adding and Filtering External Web Resources example:

    ...
    <configuration>
      <webResources>
        <resource>
          ...
        </resource>
        <resource>
          <directory>src/main/java</directory>
          <!-- override the destination directory for this resource -->
          <targetPath>WEB-INF/src</targetPath>
        </resource>
        <resource>
          <directory>src/main/resources</directory>
          <!-- override the destination directory for this resource -->
          <targetPath>WEB-INF/src</targetPath>
        </resource>
      </webResources>
    </configuration>
    ...
Pascal Thivent
Thanks a lot, I will try :-)
SourceRebels
@SourceRebels You're welcome.
Pascal Thivent
It worked. Thanks again.
SourceRebels