You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alain MAHIER <ma...@wanadoo.fr> on 2005/05/19 15:44:53 UTC

Troubles when calling ant build files

Hi,

I have trouble when calling ant tasks executing junit tests from maven. Are there any known issues about this problem ?

ANT BUILD FILE

  <target name="runTests">
      <mkdir dir="target/test-results"/>
      <junit printsummary="true" showoutput="true">
        <classpath>
          <pathelement location="${classes.dir}"/>
          <pathelement location="${maven.repo.local}/log4j/jars/log4j-1.2.8.jar"/>
          <pathelement location="${maven.repo.local}/commons-lang/jars/commons-lang-2.0.jar"/>
        </classpath>
        <batchtest todir="target/test-results">
          <formatter type="xml"/>
          <fileset dir="${classes.dir}">
              <include name="**/*Test.class"/>
          </fileset>
        </batchtest>
      </junit>
  </target>

MAVEN FILE

	<goal name="callRunTests">
		<ant:ant antfile="${basedir}/build/build.xml" target="runTests"/>
	</goal>

When executing maven callRunTests, ant tells me he cannot find junit task ? Do you know why ?

Thanks you in advance
Alain MAHIER



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Troubles when calling ant build files

Posted by Brett Porter <br...@gmail.com>.
you need to either cpoy junit.jar to $MAVEN_HOME/lib which is what you
usually have to do for Ant - I don't recommend this. Instead, declare
a dependency on junit like this:

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <properties>
    <classloader>root</classloader>
  </properties>
</dependency>

On 5/19/05, Alain MAHIER <ma...@wanadoo.fr> wrote:
> Hi,
> 
> I have trouble when calling ant tasks executing junit tests from maven. Are there any known issues about this problem ?
> 
> ANT BUILD FILE
> 
>   <target name="runTests">
>       <mkdir dir="target/test-results"/>
>       <junit printsummary="true" showoutput="true">
>         <classpath>
>           <pathelement location="${classes.dir}"/>
>           <pathelement location="${maven.repo.local}/log4j/jars/log4j-1.2.8.jar"/>
>           <pathelement location="${maven.repo.local}/commons-lang/jars/commons-lang-2.0.jar"/>
>         </classpath>
>         <batchtest todir="target/test-results">
>           <formatter type="xml"/>
>           <fileset dir="${classes.dir}">
>               <include name="**/*Test.class"/>
>           </fileset>
>         </batchtest>
>       </junit>
>   </target>
> 
> MAVEN FILE
> 
>         <goal name="callRunTests">
>                 <ant:ant antfile="${basedir}/build/build.xml" target="runTests"/>
>         </goal>
> 
> When executing maven callRunTests, ant tells me he cannot find junit task ? Do you know why ?
> 
> Thanks you in advance
> Alain MAHIER
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org