On Yesterday at 9:05pm, =>[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

  [..snip..]

this doesn't work as "src/main/webapp/" is not on the classpath. Is there a way to tell maven to have src/main/webapp on its classpath? Or what else is best practice to test resources in src/main/webapp?

kind regards,
janning


Hi Janning,

You cannot achieve this with the current surefire.

We do it by patching surefire. Essentially, by using the patch:
http://jira.codehaus.org/secure/attachment/23139/additionalClasspaths.patch
from this JIRA item:
http://jira.codehaus.org/browse/SUREFIRE-118
surefire now has the capability to add additional classpath elements. If you like this feature, vote for this jira item. I have been using this patch for about almost a year now.

In our case our plugin config looks something like:

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.ver}</version>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>
                            src/main/webapp
                        </additionalClasspathElement>
                    </additionalClasspathElements>
                </configuration>
            </plugin>

You can add more <additionalClasspathElement> nodes based upon your needs.

Hope that helps.

Cheers,
--
Haroon Rafique
<[EMAIL PROTECTED]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to