Phiên bản nguồn và đích có thể được đặt riêng cho mục tiêu compile và testCompile của maven compiler plugin. Bạn có thể thay đổi các thiết lập bằng cách xác định các thuộc tính trong pom của bạn:
<properties>
<maven.compiler.source>1.4</maven.compiler.source>
<maven.compiler.target>1.4</maven.compiler.target>
<maven.compiler.testSource>1.5</maven.compiler.testSource>
<maven.compiler.testTarget>1.5</maven.compiler.testTarget>
</properties>
Hoặc bằng cách cấu hình rõ ràng của các plugin trình biên dịch:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version>
<configuration>
<source>1.4</source>
<target>1.4</target>
<testSource>1.5</testSource>
<testTarget>1.5</testTarget>
</configuration>
</plugin>
Nguồn
2012-05-15 16:40:56