I'm new to maven, but I believe you need to configure the maven java plug-in
for anything other than Java 1.3. You do this under the plugin tag within
the build tag. Look at:
http://maven.apache.org/maven-1.x/plugins/java/properties.html.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.4</source>
<target>1.4</target>
</configuration>
</plugin>
-----Original Message-----
From: datech [mailto:[EMAIL PROTECTED]
Sent: Monday, October 02, 2006 1:44 PM
To: [email protected]
Subject: Maven-TestNG with JDK 1.4 - Asserts not working
I am using JDK1.4 assert statements in TestNG test. When I try to compile
the
test using Maven 2.0 (mvn test-compile), it doesn't recognize assert
statement and give compilation failure :
"BasicTest.java:[28,15] ';' expected "
on the following code.
public void basicTest() {
int cnt = getCount();
assert cnt > 0 : "COUNT NOT GREATER THAN ZERO";
}
Surefire enables the assertion by default so I don't need to specify it in
POM surefire plugin configuration. But I did try that too but it's still not
working.
Here's part of my POM
<project>
...
<build>
<sourceDirectory>src/</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-
plugin</artifactId>
<configuration>
<groups>basic</groups>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
Not sure why it's failing. Please help? Thanks
(I am able to compile the code using javac command)
--
View this message in context:
http://www.nabble.com/Maven-TestNG-with-JDK-1.4---Asserts-not-working-tf2371
315.html#a6606185
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
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]