idea maven 报-source 1.5 中不支持 diamond 运算符

时间:2023-01-06 13:39:51
"C:\Program Files\Java\jdk1.8.0_144\bin\java" -Dmaven.multiModuleProjectDirectory=D:\file\dqs_jx "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\lib\idea_rt.jar=51512:C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2017.3\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.3.1 org.mortbay.jetty:jetty-maven-plugin:8.1.15.v20140411:run
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.dqs:dqs:war:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.axis:axis:jar -> duplicate declaration of version 1.3 @ line 264, column 21
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.jfinal:jfinal:jar -> version 3.0 vs 1.9 @ line 269, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building dqs 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:8.1.15.v20140411:run (default-cli) > test-compile @ dqs >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ dqs ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 8 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ dqs ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 297 source files to D:\file\dqs_jx\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /D:/file/dqs_jx/src/main/java/com/dqs/controller/ReportController.java:[104,61] -source 1.5 中不支持 diamond 运算符
  (请使用 -source 7 或更高版本以启用 diamond 运算符)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.031 s
[INFO] Finished at: 2017-12-22T09:29:07+08:00
[INFO] Final Memory: 13M/207M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dqs: Compilation failure
[ERROR] /D:/file/dqs_jx/src/main/java/com/dqs/controller/ReportController.java:[104,61] -source 1.5 中不支持 diamond 运算符
[ERROR] (请使用 -source 7 或更高版本以启用 diamond 运算符)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Process finished with exit code 1

需要修改 project setting 中的

idea maven 报-source 1.5 中不支持 diamond 运算符

 

划重点!还有一个地方!就是

idea maven 报-source 1.5 中不支持 diamond 运算符

需要跟刚刚的setting 的javac版本对应