You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Csatári János <cs...@tanet.hu> on 2011/06/15 17:50:22 UTC

ANT 1.8.2 + JUnit error

Hi there!

I have ANT 1.8.2 and also JUnit installed. However, when I would like to use the junit task in the build.xml, I get the following error: 

build.xml:188: The <classpath> for <junit> must include junit.jar if not in Ant's own classpath

Here's the relevant parts of the build.xml: 


	<property name="report.dir"   value="report"/>
	<property name="junit.out.dir.xml"  value="${report.dir}xml"/>
	<property name="junit.out.dir.html" value="${report.dir}/html"/>
	

	<target name="validating the results" depends="discovering the topology">
		<description>Validating the results of the discovery process.</description>
		<echo>Validating the results...</echo>
		
                <delete dir="${junit.out.dir.xml}"/>
                <mkdir  dir="${junit.out.dir.xml}"/>
                <junit printsummary="yes" haltonfailure="no">
                     <formatter type="xml"/>
                     <batchtest fork="yes" todir="${junit.out.dir.xml}">
                
                     </batchtest>
                </junit>
</project>

I have the ant-junit.jar and junit.jar both in the %ANT_HOME%/lib directory and also in the project lib directory. I've tried every solution found on google, but none of them worked. I also included classpath in the junit task, but that doesn't worked.

Could you give me please some advice?

Greetings,
János Csatári

___________________________________





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ANT 1.8.2 + JUnit error

Posted by Csatári János <cs...@tanet.hu>.
It seems now it works, I just simply needed to add

        	<classpath>
        		<pathelement location="./lib/junit.jar" path="./lib/junit.jar"/>
        	</classpath>

to the junit tasks. Anyway, thank you for your fast response! :)

Kasim Ahmed <ma...@googlemail.com> írta :

> in your ant-home library include ant-junit.jar( if not avaialble) and run again. 2011/6/15 Csatári János <cs...@tanet.hu>
> Hi there!
> 
> I have ANT 1.8.2 and also JUnit installed. However, when I would like to use the junit task in the build.xml, I get the following error:
> 
> build.xml:188: The <classpath> for <junit> must include junit.jar if not in Ant&#39;s own classpath
> 
> Here&#39;s the relevant parts of the build.xml:
> 
> 
>         <property name="report.dir"   value="report"/>
>         <property name="junit.out.dir.xml"  value="${report.dir}xml"/>
>         <property name="junit.out.dir.html" value="${report.dir}/html"/>
> 
> 
>         <target name="validating the results" depends="discovering the topology">
>                 <description>Validating the results of the discovery process.</description>
>                 <echo>Validating the results...</echo>
> 
>                 <delete dir="${junit.out.dir.xml}"/>
>                 <mkdir  dir="${junit.out.dir.xml}"/>
>                 <junit printsummary="yes" haltonfailure="no">
>                      <formatter type="xml"/>
>                      <batchtest fork="yes" todir="${junit.out.dir.xml}">
> 
>                      </batchtest>
>                 </junit>
> </project>
> 
> I have the ant-junit.jar and junit.jar both in the %ANT_HOME%/lib directory and also in the project lib directory. I&#39;ve tried every solution found on google, but none of them worked. I also included classpath in the junit task, but that doesn&#39;t worked.
> 
> 
> Could you give me please some advice?
> 
> Greetings,
> János Csatári
> 
> ___________________________________
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org



___________________________________





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: ANT 1.8.2 + JUnit error

Posted by kasim ahmed <ma...@googlemail.com>.
in your ant-home library include ant-junit.jar( if not avaialble) and run
again.

2011/6/15 Csatári János <cs...@tanet.hu>

> Hi there!
>
> I have ANT 1.8.2 and also JUnit installed. However, when I would like to
> use the junit task in the build.xml, I get the following error:
>
> build.xml:188: The <classpath> for <junit> must include junit.jar if not in
> Ant's own classpath
>
> Here's the relevant parts of the build.xml:
>
>
>        <property name="report.dir"   value="report"/>
>        <property name="junit.out.dir.xml"  value="${report.dir}xml"/>
>        <property name="junit.out.dir.html" value="${report.dir}/html"/>
>
>
>        <target name="validating the results" depends="discovering the
> topology">
>                <description>Validating the results of the discovery
> process.</description>
>                <echo>Validating the results...</echo>
>
>                <delete dir="${junit.out.dir.xml}"/>
>                <mkdir  dir="${junit.out.dir.xml}"/>
>                <junit printsummary="yes" haltonfailure="no">
>                     <formatter type="xml"/>
>                     <batchtest fork="yes" todir="${junit.out.dir.xml}">
>
>                     </batchtest>
>                </junit>
> </project>
>
> I have the ant-junit.jar and junit.jar both in the %ANT_HOME%/lib directory
> and also in the project lib directory. I've tried every solution found on
> google, but none of them worked. I also included classpath in the junit
> task, but that doesn't worked.
>
> Could you give me please some advice?
>
> Greetings,
> János Csatári
>
> ___________________________________
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>