You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sebastian Weber <se...@outlawtrail.de> on 2006/12/16 01:27:40 UTC

Ant 1.6.5 and JUnit task

Hi everybody,

I am sure that I am not the first one to post that particular question 
here, but I'm very close to snapping my keyboard in half, because I 
can't get it done.

I set up an Anthill build management server on a Fedora based linux 
system. The machine I am working on is a server on which I don't have 
full root access. Anthill is deployed in a JBoss 4.0.4.GA Patch1 JBoss 
server. I can check out my project from the SVN repository and build it. 
My Ant script deploys the build to JBoss, the connection to the DB is 
established everything fine. And then I try to run the JUnit tests via 
the script.

If I see that

"This is common and has a number of causes; the usual 
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file: 
 - You have misspelt 'junit'.
   Fix: check your spelling.

[...]"


error message once more . . . 

I tried to put the junit.jar in the ANT_HOME/lib folder, I tried the same with a symbolic link to junit.jar in that folder,
I tried to find the appropriate place for a CLASSPATH entry in one or another init or conf script,
I tried to taskdef junit tasks (which switched the above error message to a "ClassNotFoundException" for the test classes),
I even tried the new Ant 1.7.0RC1 which claims to solve that particular problem. Well, obviously it does not, otherwise I would
not be begging for help.


I ran out of ideas and would appreciate any useful hint that might lead to a solution. Any script where I can put the classpath
definition in, any location where I can copy the junit.jar, any useful webpage (other than Ant FAQ...) or just ANYTHING!


Sebastian









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


Re: Ant 1.6.5 and JUnit task

Posted by Sebastian Weber <se...@outlawtrail.de>.
Hello Antoine,

"echo $ANT_HOME" returns

ANT_HOME: Undefined variable.

and "which ant" returns

/usr/bin/ant

How can I check if Anthill sees the same settings?

I use AnthillOS which has far less options to set than AnthillPro. It 
comes with the binary versions of Ant 1.5.1 and 1.6.2 in its lib folder. 
I just added versions 1.6.5 and as that did not work 1.7.0RC1 to that 
folder and adjusted Anthill's path settings accordingly.
I tried that on an older machine before and it worked fine but on the 
new test server it does not.

Greetings,

Sebastian

Antoine Levy-Lambert wrote:
> Hello Sebastian,
>
> there might be a possibility to fix that without deleting files. 
> Although deleting these files would not harm.
>
> I suppose that in the path there is an older version of the ant script 
> than the one in the Ant 1.7.0 installation directory.
>
> What do you see when you do :
>
> echo  $ANT_HOME
> which ant
>
> also does your Anthill see the same ?
>
> Is there maybe an Ant version which is part of JBoss ?
>
> Do you know that in AnthillPro you can configure different ant 
> versions, telling AnthillPro where they are installed.
>
> Regards,
>
> Antoine
>
>
>
> On Dec 17, 2006, at 12:01 AM, Sebastian Weber wrote:
>
>> @Antoine
>>
>> Thanks for the tip. I found
>>
>> /etc/ant.conf
>> /etc/ant.d (empty folder)
>> /usr/share/ant/ant-update.xsl
>> /usr/share/ant/changelog.xsl
>> /usr/share/ant/junit-frames-xalan1.xsl
>> /usr/share/ant/log.xsl  tagdiff.xsl
>>
>> If they are the reason for the failed builds how can I get rid of 
>> them? Is it enough to simply delete these files and folders? I 
>> already tried to move them elsewhere but got a 'permission denied' 
>> error so I would have to ask our server admins to do that.
>>
>>
>> @Peter
>>
>> I tried to use the fail task but got the following error when I ran 
>> the build:
>>
>> Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the 
>> nested "antversion" element.
>>
>>
>> The junit.jar already is in the lib folder, I just cannot convince 
>> Ant to use it ...
>>
>>
>>>
>>>  <fail>
>>>    <condition>
>>>      <not>
>>>        <antversion atleast="1.7.0"/>
>>>      </not>
>>>    </condition>
>>>  </fail>
>>> (a bit verbose ... .. but does the work)
>>>
>>> * use the ability of ant 1.7 to have the junit.jar in the classpath
>>> of the <junit> task.
>>>
>>> <junit...
>>>    <classpath>
>>>        <path path="PATH_TO_JUNIT.JAR"/>
>>>        ....
>>>    </classpath>
>>> </junit>
>>>
>>> And have the junit.jar in your project lib directory.
>>>
>>> I have started to getting my team using this template :-)
>>>
>>> Peter
>>>
>>>
>>> On 12/16/06, Antoine Levy-Lambert <an...@gmx.de> wrote:
>>>> Hello Sebastian,
>>>>
>>>> there might be a system wide ant installed on your system. Check for
>>>> the presence of a file called /etc/ant.conf. This one might be the
>>>> one which is killing you.
>>>>
>>>> see this posting by Peter Reilly : http://marc.theaimsgroup.com/?
>>>> l=ant-user&m=116378339914211&w=2
>>>>
>>>> Regards,
>>>> Antoine
>>>> On Dec 15, 2006, at 7:27 PM, Sebastian Weber wrote:
>>>>
>>>> > Hi everybody,
>>>> >
>>>> > I am sure that I am not the first one to post that particular
>>>> > question here, but I'm very close to snapping my keyboard in half,
>>>> > because I can't get it done.
>>>> >
>>>> > I set up an Anthill build management server on a Fedora based linux
>>>> > system. The machine I am working on is a server on which I don't
>>>> > have full root access. Anthill is deployed in a JBoss 4.0.4.GA
>>>> > Patch1 JBoss server. I can check out my project from the SVN
>>>> > repository and build it. My Ant script deploys the build to JBoss,
>>>> > the connection to the DB is established everything fine. And then I
>>>> > try to run the JUnit tests via the script.
>>>> >
>>>> > If I see that
>>>> >
>>>> > "This is common and has a number of causes; the usual solutions are
>>>> > to read the manual pages then download and
>>>> > install needed JAR files, or fix the build file: - You have
>>>> > misspelt 'junit'.
>>>> >   Fix: check your spelling.
>>>> >
>>>> > [...]"
>>>> >
>>>> >
>>>> > error message once more . . .
>>>> > I tried to put the junit.jar in the ANT_HOME/lib folder, I tried
>>>> > the same with a symbolic link to junit.jar in that folder,
>>>> > I tried to find the appropriate place for a CLASSPATH entry in one
>>>> > or another init or conf script,
>>>> > I tried to taskdef junit tasks (which switched the above error
>>>> > message to a "ClassNotFoundException" for the test classes),
>>>> > I even tried the new Ant 1.7.0RC1 which claims to solve that
>>>> > particular problem. Well, obviously it does not, otherwise I would
>>>> > not be begging for help.
>>>> >
>>>> >
>>>> > I ran out of ideas and would appreciate any useful hint that might
>>>> > lead to a solution. Any script where I can put the classpath
>>>> > definition in, any location where I can copy the junit.jar, any
>>>> > useful webpage (other than Ant FAQ...) or just ANYTHING!
>>>> >
>>>> >
>>>> > Sebastian
>>>> >
>>>> >
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>> ---------------------------------------------------------------------
>> 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

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


Re: Ant 1.6.5 and JUnit task

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Sebastian,

there might be a possibility to fix that without deleting files.  
Although deleting these files would not harm.

I suppose that in the path there is an older version of the ant  
script than the one in the Ant 1.7.0 installation directory.

What do you see when you do :

echo  $ANT_HOME
which ant

also does your Anthill see the same ?

Is there maybe an Ant version which is part of JBoss ?

Do you know that in AnthillPro you can configure different ant  
versions, telling AnthillPro where they are installed.

Regards,

Antoine



On Dec 17, 2006, at 12:01 AM, Sebastian Weber wrote:

> @Antoine
>
> Thanks for the tip. I found
>
> /etc/ant.conf
> /etc/ant.d (empty folder)
> /usr/share/ant/ant-update.xsl
> /usr/share/ant/changelog.xsl
> /usr/share/ant/junit-frames-xalan1.xsl
> /usr/share/ant/log.xsl  tagdiff.xsl
>
> If they are the reason for the failed builds how can I get rid of  
> them? Is it enough to simply delete these files and folders? I  
> already tried to move them elsewhere but got a 'permission denied'  
> error so I would have to ask our server admins to do that.
>
>
> @Peter
>
> I tried to use the fail task but got the following error when I ran  
> the build:
>
> Class org.apache.tools.ant.taskdefs.condition.Not doesn't support  
> the nested "antversion" element.
>
>
> The junit.jar already is in the lib folder, I just cannot convince  
> Ant to use it ...
>
>
>>
>>  <fail>
>>    <condition>
>>      <not>
>>        <antversion atleast="1.7.0"/>
>>      </not>
>>    </condition>
>>  </fail>
>> (a bit verbose ... .. but does the work)
>>
>> * use the ability of ant 1.7 to have the junit.jar in the classpath
>> of the <junit> task.
>>
>> <junit...
>>    <classpath>
>>        <path path="PATH_TO_JUNIT.JAR"/>
>>        ....
>>    </classpath>
>> </junit>
>>
>> And have the junit.jar in your project lib directory.
>>
>> I have started to getting my team using this template :-)
>>
>> Peter
>>
>>
>> On 12/16/06, Antoine Levy-Lambert <an...@gmx.de> wrote:
>>> Hello Sebastian,
>>>
>>> there might be a system wide ant installed on your system. Check for
>>> the presence of a file called /etc/ant.conf. This one might be the
>>> one which is killing you.
>>>
>>> see this posting by Peter Reilly : http://marc.theaimsgroup.com/?
>>> l=ant-user&m=116378339914211&w=2
>>>
>>> Regards,
>>> Antoine
>>> On Dec 15, 2006, at 7:27 PM, Sebastian Weber wrote:
>>>
>>> > Hi everybody,
>>> >
>>> > I am sure that I am not the first one to post that particular
>>> > question here, but I'm very close to snapping my keyboard in half,
>>> > because I can't get it done.
>>> >
>>> > I set up an Anthill build management server on a Fedora based  
>>> linux
>>> > system. The machine I am working on is a server on which I don't
>>> > have full root access. Anthill is deployed in a JBoss 4.0.4.GA
>>> > Patch1 JBoss server. I can check out my project from the SVN
>>> > repository and build it. My Ant script deploys the build to JBoss,
>>> > the connection to the DB is established everything fine. And  
>>> then I
>>> > try to run the JUnit tests via the script.
>>> >
>>> > If I see that
>>> >
>>> > "This is common and has a number of causes; the usual solutions  
>>> are
>>> > to read the manual pages then download and
>>> > install needed JAR files, or fix the build file: - You have
>>> > misspelt 'junit'.
>>> >   Fix: check your spelling.
>>> >
>>> > [...]"
>>> >
>>> >
>>> > error message once more . . .
>>> > I tried to put the junit.jar in the ANT_HOME/lib folder, I tried
>>> > the same with a symbolic link to junit.jar in that folder,
>>> > I tried to find the appropriate place for a CLASSPATH entry in one
>>> > or another init or conf script,
>>> > I tried to taskdef junit tasks (which switched the above error
>>> > message to a "ClassNotFoundException" for the test classes),
>>> > I even tried the new Ant 1.7.0RC1 which claims to solve that
>>> > particular problem. Well, obviously it does not, otherwise I would
>>> > not be begging for help.
>>> >
>>> >
>>> > I ran out of ideas and would appreciate any useful hint that might
>>> > lead to a solution. Any script where I can put the classpath
>>> > definition in, any location where I can copy the junit.jar, any
>>> > useful webpage (other than Ant FAQ...) or just ANYTHING!
>>> >
>>> >
>>> > Sebastian
>>> >
>>> >
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> 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
>
>
> ---------------------------------------------------------------------
> 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.6.5 and JUnit task

Posted by Sebastian Weber <se...@outlawtrail.de>.
@Antoine

Thanks for the tip. I found

/etc/ant.conf
/etc/ant.d (empty folder)
/usr/share/ant/ant-update.xsl
/usr/share/ant/changelog.xsl
/usr/share/ant/junit-frames-xalan1.xsl
/usr/share/ant/log.xsl  tagdiff.xsl

If they are the reason for the failed builds how can I get rid of them? 
Is it enough to simply delete these files and folders? I already tried 
to move them elsewhere but got a 'permission denied' error so I would 
have to ask our server admins to do that.


@Peter

I tried to use the fail task but got the following error when I ran the 
build:

Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element.


The junit.jar already is in the lib folder, I just cannot convince Ant to use it ...


>
>  <fail>
>    <condition>
>      <not>
>        <antversion atleast="1.7.0"/>
>      </not>
>    </condition>
>  </fail>
> (a bit verbose ... .. but does the work)
>
> * use the ability of ant 1.7 to have the junit.jar in the classpath
> of the <junit> task.
>
> <junit...
>    <classpath>
>        <path path="PATH_TO_JUNIT.JAR"/>
>        ....
>    </classpath>
> </junit>
>
> And have the junit.jar in your project lib directory.
>
> I have started to getting my team using this template :-)
>
> Peter
>
>
> On 12/16/06, Antoine Levy-Lambert <an...@gmx.de> wrote:
>> Hello Sebastian,
>>
>> there might be a system wide ant installed on your system. Check for
>> the presence of a file called /etc/ant.conf. This one might be the
>> one which is killing you.
>>
>> see this posting by Peter Reilly : http://marc.theaimsgroup.com/?
>> l=ant-user&m=116378339914211&w=2
>>
>> Regards,
>> Antoine
>> On Dec 15, 2006, at 7:27 PM, Sebastian Weber wrote:
>>
>> > Hi everybody,
>> >
>> > I am sure that I am not the first one to post that particular
>> > question here, but I'm very close to snapping my keyboard in half,
>> > because I can't get it done.
>> >
>> > I set up an Anthill build management server on a Fedora based linux
>> > system. The machine I am working on is a server on which I don't
>> > have full root access. Anthill is deployed in a JBoss 4.0.4.GA
>> > Patch1 JBoss server. I can check out my project from the SVN
>> > repository and build it. My Ant script deploys the build to JBoss,
>> > the connection to the DB is established everything fine. And then I
>> > try to run the JUnit tests via the script.
>> >
>> > If I see that
>> >
>> > "This is common and has a number of causes; the usual solutions are
>> > to read the manual pages then download and
>> > install needed JAR files, or fix the build file: - You have
>> > misspelt 'junit'.
>> >   Fix: check your spelling.
>> >
>> > [...]"
>> >
>> >
>> > error message once more . . .
>> > I tried to put the junit.jar in the ANT_HOME/lib folder, I tried
>> > the same with a symbolic link to junit.jar in that folder,
>> > I tried to find the appropriate place for a CLASSPATH entry in one
>> > or another init or conf script,
>> > I tried to taskdef junit tasks (which switched the above error
>> > message to a "ClassNotFoundException" for the test classes),
>> > I even tried the new Ant 1.7.0RC1 which claims to solve that
>> > particular problem. Well, obviously it does not, otherwise I would
>> > not be begging for help.
>> >
>> >
>> > I ran out of ideas and would appreciate any useful hint that might
>> > lead to a solution. Any script where I can put the classpath
>> > definition in, any location where I can copy the junit.jar, any
>> > useful webpage (other than Ant FAQ...) or just ANYTHING!
>> >
>> >
>> > Sebastian
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> 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.6.5 and JUnit task

Posted by Peter Reilly <pe...@gmail.com>.
I would suggest using ant 1.7RC1

* Add to the build file a check for ant 1.7 to ensure that
  you are using ant 1.7 or higher.

  <fail>
    <condition>
      <not>
        <antversion atleast="1.7.0"/>
      </not>
    </condition>
  </fail>
(a bit verbose ... .. but does the work)

* use the ability of ant 1.7 to have the junit.jar in the classpath
of the <junit> task.

<junit...
    <classpath>
        <path path="PATH_TO_JUNIT.JAR"/>
        ....
    </classpath>
</junit>

And have the junit.jar in your project lib directory.

I have started to getting my team using this template :-)

Peter


On 12/16/06, Antoine Levy-Lambert <an...@gmx.de> wrote:
> Hello Sebastian,
>
> there might be a system wide ant installed on your system. Check for
> the presence of a file called /etc/ant.conf. This one might be the
> one which is killing you.
>
> see this posting by Peter Reilly : http://marc.theaimsgroup.com/?
> l=ant-user&m=116378339914211&w=2
>
> Regards,
> Antoine
> On Dec 15, 2006, at 7:27 PM, Sebastian Weber wrote:
>
> > Hi everybody,
> >
> > I am sure that I am not the first one to post that particular
> > question here, but I'm very close to snapping my keyboard in half,
> > because I can't get it done.
> >
> > I set up an Anthill build management server on a Fedora based linux
> > system. The machine I am working on is a server on which I don't
> > have full root access. Anthill is deployed in a JBoss 4.0.4.GA
> > Patch1 JBoss server. I can check out my project from the SVN
> > repository and build it. My Ant script deploys the build to JBoss,
> > the connection to the DB is established everything fine. And then I
> > try to run the JUnit tests via the script.
> >
> > If I see that
> >
> > "This is common and has a number of causes; the usual solutions are
> > to read the manual pages then download and
> > install needed JAR files, or fix the build file: - You have
> > misspelt 'junit'.
> >   Fix: check your spelling.
> >
> > [...]"
> >
> >
> > error message once more . . .
> > I tried to put the junit.jar in the ANT_HOME/lib folder, I tried
> > the same with a symbolic link to junit.jar in that folder,
> > I tried to find the appropriate place for a CLASSPATH entry in one
> > or another init or conf script,
> > I tried to taskdef junit tasks (which switched the above error
> > message to a "ClassNotFoundException" for the test classes),
> > I even tried the new Ant 1.7.0RC1 which claims to solve that
> > particular problem. Well, obviously it does not, otherwise I would
> > not be begging for help.
> >
> >
> > I ran out of ideas and would appreciate any useful hint that might
> > lead to a solution. Any script where I can put the classpath
> > definition in, any location where I can copy the junit.jar, any
> > useful webpage (other than Ant FAQ...) or just ANYTHING!
> >
> >
> > Sebastian
> >
> >
>
>
> ---------------------------------------------------------------------
> 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.6.5 and JUnit task

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Sebastian,

there might be a system wide ant installed on your system. Check for  
the presence of a file called /etc/ant.conf. This one might be the  
one which is killing you.

see this posting by Peter Reilly : http://marc.theaimsgroup.com/? 
l=ant-user&m=116378339914211&w=2

Regards,
Antoine
On Dec 15, 2006, at 7:27 PM, Sebastian Weber wrote:

> Hi everybody,
>
> I am sure that I am not the first one to post that particular  
> question here, but I'm very close to snapping my keyboard in half,  
> because I can't get it done.
>
> I set up an Anthill build management server on a Fedora based linux  
> system. The machine I am working on is a server on which I don't  
> have full root access. Anthill is deployed in a JBoss 4.0.4.GA  
> Patch1 JBoss server. I can check out my project from the SVN  
> repository and build it. My Ant script deploys the build to JBoss,  
> the connection to the DB is established everything fine. And then I  
> try to run the JUnit tests via the script.
>
> If I see that
>
> "This is common and has a number of causes; the usual solutions are  
> to read the manual pages then download and
> install needed JAR files, or fix the build file: - You have  
> misspelt 'junit'.
>   Fix: check your spelling.
>
> [...]"
>
>
> error message once more . . .
> I tried to put the junit.jar in the ANT_HOME/lib folder, I tried  
> the same with a symbolic link to junit.jar in that folder,
> I tried to find the appropriate place for a CLASSPATH entry in one  
> or another init or conf script,
> I tried to taskdef junit tasks (which switched the above error  
> message to a "ClassNotFoundException" for the test classes),
> I even tried the new Ant 1.7.0RC1 which claims to solve that  
> particular problem. Well, obviously it does not, otherwise I would
> not be begging for help.
>
>
> I ran out of ideas and would appreciate any useful hint that might  
> lead to a solution. Any script where I can put the classpath
> definition in, any location where I can copy the junit.jar, any  
> useful webpage (other than Ant FAQ...) or just ANYTHING!
>
>
> Sebastian
>
>


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