为什么java 7不能使用diamond运算符和multi-catch语句

使用Java 7(1.7.0_67)和Project语言级别设置为7-Diamonds,ARM,multi-catch。 我的代码如下,在使用maven构建时抛出编译错误的行。

private Map<String, List> classMap = new HashMap(); //line 36 in InstrumentingAgent 

InstrumentingAgent第63行中的多捕获块

 } catch (InstrumentationException | JAXBException e){ e.getMessage(); } 

我在编译时遇到以下错误。 为什么不起作用? 我究竟做错了什么。 我正在使用IntelliJ IDE。

 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project instrumentation-agent: Compilation failure: Compilation failure: [ERROR] /home/Documents/instrumentation-agent/src/main/java/org/wso2/das/javaagent/instrumentation/InstrumentingAgent.java:[36,79] error: diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable diamond operator) [ERROR] /home/Documents/instrumentation-agent/src/main/java/org/wso2/das/javaagent/instrumentation/InstrumentingAgent.java:[63,47] error: multi-catch statement is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable multi-catch statement) 

根据我读到的内容,钻石运营商应该使用Java 7.但为什么我会这样做。 如果我用相关类型填充钻石,那么IDE会将它们变成灰色并说它可能已经被钻石操作员取代。 但是当我更换它时会出现以下错误。

在pom中添加以下内容解决了编译错误,

  maven-compiler-plugin 3.2  1.7 1.7