sourcerebels
sourcerebels

Reputation: 5180

Hudson and Maven. Packaging sources/resources to WEB-INF/src

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.

Upvotes: 1

Views: 211

Answers (1)

Pascal Thivent
Pascal Thivent

Reputation: 570285

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>
    ...

Upvotes: 3

Related Questions