I have junit.jar in my classpath and can compile JUnit Test classes with java at the command line. I am attempting to compile a simple JUnit class file, but when I attempt to compile the JUnit class with maven it does not find the junit.jar. Can you please let me know what I am doing wrong?
-Andy Hale
*Here is my project.xml:
*--------CUT--------- <project> <id>nesso</id> <currentVersion>1.0</currentVersion> <build> <sourceDirectory> ${basedir}/src/java </sourceDirectory> </build> <unitTestSourceDirectory> ${basedir}/src/test </unitTestSourceDirectory> </project> --------CUT---------
*The output when attempting to run maven:*
--------CUT--------- $ maven java:jar __ __ | \/ |__ _Apache__ ___ | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~ |_| |_\__,_|\_/\___|_||_| v. 1.0-rc1-SNAPSHOT
java:prepare-filesystem:
java:compile:
[echo] Compiling to /home/halea/sandbox/nesso/current/target/classes
[javac] Compiling 2 source files to /home/halea/sandbox/nesso/current/target/classes
/home/halea/sandbox/nesso/current/src/java/nesso/metnet/navy/mil/BoxTest.java:3: package junit.framework does not exist
import junit.framework.TestCase;
^
/home/halea/sandbox/nesso/current/src/java/nesso/metnet/navy/mil/BoxTest.java:5: cannot resolve symbol
symbol : class TestCase
location: class nesso.metnet.navy.mil.BoxTest
public class BoxTest extends TestCase{
^
/home/halea/sandbox/nesso/current/src/java/nesso/metnet/navy/mil/BoxTest.java:9: cannot resolve symbol
symbol : method assertEquals (int,int)
location: class nesso.metnet.navy.mil.BoxTest
assertEquals(4,b.getArea());
^
3 errors
BUILD FAILED File...... file:/home/halea/.maven/plugins/maven-java-plugin-1.3/ Element... ant:javac Line...... 34 Column.... 48 Compile failed; see the compiler error output for details. Total time: 8 seconds Finished at: Tue Mar 02 10:40:05 PST 2004 --------CUT--------- ****