Maven 给出错误:-source 1.5 中不支持使用资源进行试用
当我尝试使用IntelliJ 12.1.4和Java 7使用Maven 3.0.5创建jar时遇到错误。我能够通过IDE运行项目,没有任何问题,但是当我尝试打包它时,我得到以下错误。
我的POM的相关部分(取自)是:Maven By Example
Sonatype
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>jar-with-dependencies</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
错误是:
[ERROR] ...[33,55] error: diamond operator is not supported in -source 1.5
[ERROR] ...[207,7] error: try-with-resources is not supported in -source 1.5
[ERROR] ...[73,52] error: diamond operator is not supported in -source 1.5
[ERROR] ...[129,40] error: multi-catch statement is not supported in -source 1.5
[ERROR] ...[44,6] error: try-with-resources is not supported in -source 1.5
[ERROR] ...[28,39] error: diamond operator is not supported in -source 1.5
[ERROR] ...[31,7] error: try-with-resources is not supported in -source 1.5
[ERROR] ...[38,6] error: try-with-resources is not supported in -source 1.5
[ERROR] ...[34,41] error: diamond operator is not supported in -source 1.5
[ERROR] ...[77,43] error: diamond operator is not supported in -source 1.5
[ERROR] ...[84,6] error: try-with-resources is not supported in -source 1.5
[ERROR] ...[281,38] error: diamond operator is not supported in -source 1.5
[ERROR] ...[13,55] error: diamond operator is not supported in -source 1.5
[ERROR] ...[155,7] error: try-with-resources is not supported in -source 1.5
如何让 maven 使用源代码 1.7?