Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven: (use -source 5 or higher to enable static import declarations)

Tags:

java

maven-2

How can I use source 5? I tried

mvn -source 5 test 

but it didn't work :-)

When I compile the file by javac, everything works.

like image 359
ryskajakub Avatar asked Mar 15 '10 23:03

ryskajakub


1 Answers

You need to configure the maven-compiler-plugin:

<project>   ...   <build>     <plugins>       <plugin>         <groupId>org.apache.maven.plugins</groupId>         <artifactId>maven-compiler-plugin</artifactId>         <version>2.3.2</version>         <configuration>           <source>1.5</source>           <target>1.5</target>         </configuration>       </plugin>       ...     </plugins>     ...   </build> </project> 

EDIT: Changed example to use latest version of the plugin.

like image 109
Pascal Thivent Avatar answered Sep 19 '22 20:09

Pascal Thivent