Just add a plugin configuration for the maven-compiler-plugin to your project
pom. The example below shows such a configuration. Sorry its not nicely
color coded.

<project>
        <modelVersion>4.0.0</modelVersion>
        <groupId>bla.examples</groupId>
        <artifactId>bla</artifactId>
        <name>Bla</name>
        <version>1.1</version>
        <build>
                <sourceDirectory>src/main</sourceDirectory>
                <testSourceDirectory>src/test</testSourceDirectory>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                </configuration>
                        </plugin>               
                        <!-- ... any other configurations -->                   
                </plugins>
        </build>
  <!-- ... any other configurations -->     
</project>

There are probably other ways to do it too but I have not used any other ...

Cheers,
Niels




reno-2 wrote:
> 
> hello guys,
> 
> a little problem with maven and JUnit test.
> i use JUnit 4.1 and a jdk 1.6.0_03 under linux (ubuntu)
> 
> my JAVA_HOME is correctly set and MAVEN_HOME too !
> 
> i wrote test classes with static import, annotations and generics.
> when i run maven in a terminal
> 
> mvn test-compile
> 
> i've got the following output:
> 
> [ERROR] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Compilation failure
> 
> /<my_project>/src/test/java/TestParser.java:[7,7] static import 
> declarations are not supported in -source 1.3
> (use -source 5 or higher to enable static import declarations)
> import static org.junit.Assert.*;
> 
> /<my_project>/src/test/java/TestParser.java:[24,2] annotations are not 
> supported in -source 1.3
> (use -source 5 or higher to enable annotations)
>         @Test
> etc...
> 
> what am i doing wrong?
> 
> regards
> supareno
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/JUnit-test-compilation-problems-tp14724908s177p14726940.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to