Am Montag, 13. August 2007 17:19 schrieb Doug Douglass:
> Instead of trying to configure surefire, just add a test resource to your
> projects build.
> We use the follow pom snippet inherited by all our war projects:
>
> <build>
>     [..snip..]
>     <testResources>
>       <testResource>
>         <directory>src/main/webapp</directory>
>       </testResource>
>       <testResource>
>         <directory>src/test/resources</directory>
>       </testResource>
>     </testResources>
>     [..snip..]
> </build>

great. it works now from the command line.
  mvn -Dtest=MailServiceTest test

one more hint for those reading this thread. to get your unit test work in 
eclipse you need to add src/main/webapp to your classpath (.classpath 
or "Configure Build Path"). I did like this in .classpath:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry excluding="css/|download/|img/" 
     including="WEB-INF/" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con"
     path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

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

Reply via email to