You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Michael Owen <mi...@hotmail.com> on 2005/07/18 12:50:08 UTC
[M2] Marmalade script using JUnit
Hi,
As surefire in Maven2 doesn't create HTML reports yet, I'm trying to
temporary get around the problem by writing a Marmalade plugin script that
uses Ant tasks to do this. So far I'm just trying to get JUnit working
through the Marmalade. This is the execute part of my script so far:
<execute>
<ant:javac srcdir="${classes}" destdir="${junit-classes}"
classpath="${lib}" fork="yes" nowarn="on" debug="on" />
<ant:delete dir="${junit-results}" />
<ant:mkdir dir="${junit-results}" />
<ant:junit fork="yes" haltonfailure="no" timeout="${junit-timeout}">
<ant:sysproperty key="basedir" value="${basedir}" />
<ant:formatter type="xml" />
<ant:classpath path="${lib}" />
<ant:classpath>
<ant:pathelement path="${lib}" />
</ant:classpath>
<ant:batchtest todir="${junit-results}">
<ant:fileset dir="${junit-classes}" includes="**/*Test.class" />
</ant:batchtest>
</ant:junit>
</execute>
Using this I'm receiving the problem error:
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/tools/ant/launch/Locator
at
org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)
etc. etc.
Just wondering if anybody out there has done a similar thing, or knows why
such a error is occurring? I've double checked the basic things, like the
variables used are fine etc.
Thanks,
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M2] Marmalade script using JUnit
Posted by Michael Owen <mi...@hotmail.com>.
That's great. Thanks for your help. Seems obvious now you say. :-)
I'm using Ant 1.6.2 so I have the dependency for ant-launcher 1.6.2 ie:
<dependency>
<groupId>ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>1.6.2</version>
</dependency>
I'm now getting:
java.lang.ClassCastException
at.org.codehaus.marmalade.compat.ant.model.AntAdapterTag.buildAntObject(AntAdapterTag.java:138)
etc. etc.
Any ideas? Sorry, I'm new to Maven, and I'm not finding the error messages
useful yet. :)
Mike
<br><br><br>>From: Kenney Westerhof
<forge@neonics.com><br>>Reply-To: "Maven Users List"
<users@maven.apache.org><br>>To: Maven Users List
<users@maven.apache.org><br>>Subject: Re: [M2] Marmalade script
using JUnit<br>>Date: Mon, 18 Jul 2005 13:03:11 +0200
(CEST)<br>><br>>On Mon, 18 Jul 2005, Michael Owen
wrote:<br>><br>>You need to include ant-launcher as a
dependency.<br>><br>>Btw, you might find that ${a-b} is evaluated as
an expression (not sure if<br>>this is an issue in Marmalade, but this
was a problem with jelly - just<br>>thought i might warn
you).<br>><br>> > Hi,<br>> ><br>> > As surefire in
Maven2 doesn't create HTML reports yet, I'm trying to<br>> > temporary
get around the problem by writing a Marmalade plugin script that<br>>
> uses Ant tasks to do this. So far I'm just trying to get JUnit
working<br>> > through the Marmalade. This is the execute part of my
script so far:<br>> ><br>> > <execute><br>>
><br>> > <ant:javac srcdir="${classes}"
destdir="${junit-classes}"<br>> >
classpath="${lib}" fork="yes" nowarn="on"
debug="on" /><br>> ><br>> > <ant:delete
dir="${junit-results}" /><br>> > <ant:mkdir
dir="${junit-results}" /><br>> ><br>> >
<ant:junit fork="yes" haltonfailure="no"
timeout="${junit-timeout}"><br>> ><br>> >
<ant:sysproperty key="basedir" value="${basedir}"
/><br>> ><br>> > <ant:formatter type="xml"
/><br>> ><br>> > <ant:classpath
path="${lib}" /><br>> ><br>> >
<ant:classpath><br>> > <ant:pathelement
path="${lib}" /><br>> >
</ant:classpath><br>> ><br>> > <ant:batchtest
todir="${junit-results}"><br>> > <ant:fileset
dir="${junit-classes}" includes="**/*Test.class"
/><br>> > </ant:batchtest><br>> ><br>> >
</ant:junit><br>> ><br>> > </execute><br>>
><br>> ><br>> > Using this I'm receiving the problem
error:<br>> ><br>> > Exception in thread "main"
java.lang.NoClassDefFoundError:<br>> >
org/apache/tools/ant/launch/Locator<br>> > at<br>> >
org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)<br>>
><br>> > etc. etc.<br>> ><br>> ><br>> > Just
wondering if anybody out there has done a similar thing, or knows
why<br>> > such a error is occurring? I've double checked the basic
things, like the<br>> > variables used are fine etc.<br>>
><br>> > Thanks,<br>> ><br>> > Mike<br>>
><br>> ><br>> ><br>> >
---------------------------------------------------------------------<br>>
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>> >
For additional commands, e-mail: users-help@maven.apache.org<br>>
><br>><br>>--<br>>Kenney
Westerhof<br>>http://www.neonics.com<br>>GPG public key:
http://www.gods.nl/~forge/kenneyw.key<br>><br>>---------------------------------------------------------------------<br>>To
unsubscribe, e-mail: users-unsubscribe@maven.apache.org<br>>For
additional commands, e-mail: users-help@maven.apache.org<br>><br>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [M2] Marmalade script using JUnit
Posted by Kenney Westerhof <fo...@neonics.com>.
On Mon, 18 Jul 2005, Michael Owen wrote:
You need to include ant-launcher as a dependency.
Btw, you might find that ${a-b} is evaluated as an expression (not sure if
this is an issue in Marmalade, but this was a problem with jelly - just
thought i might warn you).
> Hi,
>
> As surefire in Maven2 doesn't create HTML reports yet, I'm trying to
> temporary get around the problem by writing a Marmalade plugin script that
> uses Ant tasks to do this. So far I'm just trying to get JUnit working
> through the Marmalade. This is the execute part of my script so far:
>
> <execute>
>
> <ant:javac srcdir="${classes}" destdir="${junit-classes}"
> classpath="${lib}" fork="yes" nowarn="on" debug="on" />
>
> <ant:delete dir="${junit-results}" />
> <ant:mkdir dir="${junit-results}" />
>
> <ant:junit fork="yes" haltonfailure="no" timeout="${junit-timeout}">
>
> <ant:sysproperty key="basedir" value="${basedir}" />
>
> <ant:formatter type="xml" />
>
> <ant:classpath path="${lib}" />
>
> <ant:classpath>
> <ant:pathelement path="${lib}" />
> </ant:classpath>
>
> <ant:batchtest todir="${junit-results}">
> <ant:fileset dir="${junit-classes}" includes="**/*Test.class" />
> </ant:batchtest>
>
> </ant:junit>
>
> </execute>
>
>
> Using this I'm receiving the problem error:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/tools/ant/launch/Locator
> at
> org.apache.tools.ant.util.LoaderUtils.getResourceSource(LoaderUtils.java:109)
>
> etc. etc.
>
>
> Just wondering if anybody out there has done a similar thing, or knows why
> such a error is occurring? I've double checked the basic things, like the
> variables used are fine etc.
>
> Thanks,
>
> Mike
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org