JUnit task red i build.xml

Hi!

I have two problems, which most likely is the same problem. In my build script for ant, build.xml, I have a test target with a <junit> element. Idea claims that it is not allowed there and marks it with red. When I try to run this target from the ant tab I get the error : "Could not create task or type of type: junit."

Obviously Idea don't find junit.jar in the correct place to use it.

The test source compiles properly and I can run the test if I define a target an hits Shift-F10.

The most annoying thing is the red markings.

How do I get rid of them? I think I have done it before, but I can't remember how I did and I can't check that installation.

I'm using Idea 5.0.1

/Thomas

3 comments
Comment actions Permalink

You need to add junit.jar to your Ant build files class path. This is done in the Ant tool window, via the "Properties" button. Much other handy configuration on your ant build can also be done here.

--Dave Griffith

0
Comment actions Permalink

I found another solution, you can add junit.jar to <idea installation dir>\lib\ant\lib

That seem to have the same effect as adding junit.jar to the Ant properties.

0
Comment actions Permalink


True, but this is slightly less flexible if you need different versions of JUnit for different projects.

--Dave Griffith

0

Please sign in to leave a comment.