I have not used Maven2 with Java6 as yet and can only assume your
troubles must be related to Java6. Please do report back once you've
had a chance to try this same code with Java5.
It sounds silly but I hope you've imported TestCase in your files, right?
import junit.framework.TestCase;
Wayne
On 2/16/07, Thai Dang Vu <[EMAIL PROTECTED]> wrote:
Firstly, thank you for your reply. Here is the relevant things (I hope I
copied the right stuff).
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0.1:compile' -->
[DEBUG] (f) basedir = C:\temp\maven-ex
[DEBUG] (f) buildDirectory = C:\temp\maven-ex\target
[DEBUG] (f) classpathElements = [C:\temp\maven-ex\target\classes]
[DEBUG] (f) compileSourceRoots = [C:\temp\maven-ex\src\main\java]
[DEBUG] (f) compilerId = javac
[DEBUG] (f) debug = true
[DEBUG] (f) fork = false
[DEBUG] (f) optimize = false
[DEBUG] (f) outputDirectory = C:\temp\maven-ex\target\classes
[DEBUG] (f) outputFileName = maven-ex-1.0-SNAPSHOT
[DEBUG] (f) projectArtifact =
com.ibm.devworks:maven-ex:jar:1.0-SNAPSHOT
[DEBUG] (f) showDeprecation = false
[DEBUG] (f) showWarnings = false
[DEBUG] (f) source = 1.5
[DEBUG] (f) staleMillis = 0
[DEBUG] (f) target = 1.5
[DEBUG] (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:compile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [C:\temp\maven-ex\src\main\java]
[DEBUG] Classpath: [C:\temp\maven-ex\target\classes]
[DEBUG] Output directory: C:\temp\maven-ex\target\classes
[DEBUG] Classpath:
[DEBUG] C:\temp\maven-ex\target\classes
[DEBUG] Source roots:
[DEBUG] C:\temp\maven-ex\src\main\java
Compiling 4 source files to C:\temp\maven-ex\target\classes
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-resources-plugin:2.2:testResources' -->
[DEBUG] (f) filters = []
[DEBUG] (f) outputDirectory = C:\temp\maven-ex\target\test-classes
[DEBUG] (f) project = [EMAIL PROTECTED]
[DEBUG] (f) resources = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[DEBUG] com.ibm.devworks:maven-ex:jar:1.0-SNAPSHOT (selected for null)
[DEBUG] junit:junit:jar:3.8.1:test (selected for test)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0.1:testCompile' -->
[DEBUG] (f) basedir = C:\temp\maven-ex
[DEBUG] (f) buildDirectory = C:\temp\maven-ex\target
[DEBUG] (f) classpathElements = [C:\temp\maven-ex\target\classes,
C:\temp\maven-ex\target\test-classes, C:\Documents and
Settings\tdangvu\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar]
[DEBUG] (f) compileSourceRoots = [C:\temp\maven-ex\src\test\java]
[DEBUG] (f) compilerId = javac
[DEBUG] (f) debug = true
[DEBUG] (f) fork = false
[DEBUG] (f) optimize = false
[DEBUG] (f) outputDirectory = C:\temp\maven-ex\target\test-classes
[DEBUG] (f) outputFileName = maven-ex-1.0-SNAPSHOT
[DEBUG] (f) showDeprecation = false
[DEBUG] (f) showWarnings = false
[DEBUG] (f) source = 1.5
[DEBUG] (f) staleMillis = 0
[DEBUG] (f) target = 1.5
[DEBUG] (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:testCompile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [C:\temp\maven-ex\src\test\java]
[DEBUG] Classpath: [C:\temp\maven-ex\target\classes
C:\temp\maven-ex\target\test-classes
C:\Documents and
Settings\tdangvu\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar]
[DEBUG] Output directory: C:\temp\maven-ex\target\test-classes
[DEBUG] Classpath:
[DEBUG] C:\temp\maven-ex\target\classes
[DEBUG] C:\temp\maven-ex\target\test-classes
[DEBUG] C:\Documents and
Settings\tdangvu\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
[DEBUG] Source roots:
[DEBUG] C:\temp\maven-ex\src\test\java
Compiling 2 source files to C:\temp\maven-ex\target\test-classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
C:\temp\maven-ex\src\test\java\com\ibm\devworks\NumOpsTest.java:[10,32]
cannot find symbol
symbol: class TestCase
public class NumOpsTest extends TestCase {
C:\temp\maven-ex\src\test\java\com\ibm\devworks\NumOpsTest.java:[17,8]
cannot find symbol
symbol : method assertTrue(boolean)
location: class com.ibm.devworks.NumOpsTest
C:\temp\maven-ex\src\test\java\com\ibm\devworks\NumOpsTest.java:[18,8]
cannot find symbol
symbol : method assertTrue(boolean)
location: class com.ibm.devworks.NumOpsTest
C:\temp\maven-ex\src\test\java\com\ibm\devworks\NumOpsTest.java:[20,8]
cannot find symbol
symbol : method assertTrue(boolean)
location: class com.ibm.devworks.NumOpsTest
Maven version 2.0.5, Java version 1.6.0 (from Sun).
Actually, this is not a project, just an example so that I can learn
Maven2. This example comes from the article "Introduction to Apache
Maven 2" from ibm.com/developerWorks. There are only 4 simple classes /
interfaces. I also changed the junit-3.8.1.jar in .m2 directory with the
one in Spring 2.0.2, but the result is the same.
I read somewhere (I don't remember exactly where) that Maven2 has some
problem with Java 6. I wonder if this is the case. I don't have Java 5
here (and I don't want to install it on Windows because it needs a lot
of clicks), but I'll try this at home on Ubuntu this evening where I can
easily remove Java 6 and install Java 5 with `sudo apt-get'.
-----Original Message-----
From: Wayne Fay [mailto:[EMAIL PROTECTED]
Sent: Friday, February 16, 2007 5:43 PM
To: Maven Users List
Subject: Re: mvn test doesn't work for me
Run mvn -cpu -X test and see if your problems continue.
If so, cut and paste the resulting error message (not the entire
output, but hopefully just the relevant bits near the end) in a
response email to this list.
Also, are you behind a web proxy? And where did this Maven2 project
that you're testing come from -- a internal company project, some open
source code, etc?
Wayne
On 2/16/07, Thai Dang Vu <[EMAIL PROTECTED]> wrote:
> Hello everybody,
>
> This is my 1st day with maven2 and `mvn test' doesn't work for me.
> Maven2 says it couldn't find the TestCase symbol. This is my pom.xml:
>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.ibm.devworks</groupId>
> <artifactId>maven-ex</artifactId>
> <packaging>jar</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>Maven2 Example</name>
> <url>http://www.ibm.com/java</url>
> <build>
> <plugins>
> <plugin>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> </configuration>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>junit</groupId>
> <artifactId>junit</artifactId>
> <version>3.8.1</version>
> <scope>test</scope>
> </dependency>
> </dependencies>
> </project>
>
> I'm using Windows and I can see the .m2\repository\junit\junit\3.8.1
> directory in C:\Documents and Settings\mywindowsusername. It was there
> before I run `mvn test' (maybe it was downloaded when I used AppFuse).
>
> So could anybody help me make the `mvn test' run?
>
> Thanks for any help.
>
>
>
> NOTICE: This message (including any attachments) from Momentum
Systems, Inc. contains information that is PRIVILEGED and CONFIDENTIAL.
If you are not an intended recipient, you are hereby notified that any
dissemination of this message is strictly prohibited. If you have
received this message in error, please do not read, copy or forward this
message. Please permanently delete all copies and any attachments and
notify the sender immediately by reply email or by calling our Office at
703.740.9300.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
NOTICE: This message (including any attachments) from Momentum Systems, Inc.
contains information that is PRIVILEGED and CONFIDENTIAL. If you are not an
intended recipient, you are hereby notified that any dissemination of this
message is strictly prohibited. If you have received this message in error,
please do not read, copy or forward this message. Please permanently delete
all copies and any attachments and notify the sender immediately by reply email
or by calling our Office at 703.740.9300.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]