我一直试图编译一个依赖于aspectJ-maven-plugin的项目,它在compilanceLevel 1.9(java 9)中运行得很好,但是当涉及到java 10时,它显然是不受支持的?
ERROR] Compliance options:
[ERROR] -1.3 use 1.3 compliance (-source 1.3 -target 1.1)
[ERROR] -1.4 + use 1.4 compliance (-source 1.3 -target 1.2)
[ERROR] -1.5 -5 -5.0 use 1.5 compliance (-source 1.5 -target 1.5)
[ERROR] -1.6 -6 -6.0 use 1.6 compliance (-source 1.6 -target 1.6)
[ERROR] -1.7 -7 -7.0 use 1.7 compliance (-source 1.7 -target 1.7)
[ERROR] -1.8 -8 -8.0 use 1.8 compliance (-source 1.8 -target 1.8)
[ERROR] -1.9 -9 -9.0 use 1.9 compliance (-source 1.9 -target 1.9)
[ERROR] -source <version> set source level: 1.3 to 1.9 (or 6, 6.0, etc)
[ERROR] -target <version> set classfile target: 1.1 to 1.9 (or 6, 6.0, etc)反正是为了解决这个问题吗?
发布于 2018-07-26 13:55:52
我也有这个问题。由于ajc文档已经过时,我终于在源代码中发现了问题。对于Java 10,不能将1.10用于遵从级别、源和目标。你必须用10。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.11</version>
<configuration>
<!-- MUST use 10, NOT 1.10 or ajc breaks -->
<complianceLevel>10</complianceLevel>
<source>10</source>
<target>10</target>
</configuration>
...
</plugin>https://stackoverflow.com/questions/50906879
复制相似问题