Maven AspectJ插件由于缺少工具而无法使用Java 9构建.jar
2022-09-03 01:40:15
我将JDK版本从8切换到9,由于缺少工具,AspectJ插件不再工作.jar:
目标 org.codehaus.mojo:aspectj-maven-plugin:1.10:编译失败的执行默认值:Plugin org.codehaus.mojo:aspectj-maven-plugin:1.10 或其依赖项之一无法解析:在指定的路径 C:\Program Files\Java\jdk-9.0.1/.处找不到 artifact com.sun:tools:jar:9.0.1。/lib/tools.jar
据我所知,工具.jar(和rt.jar)是从Java 9 JDK中删除的。我想知道是否有办法让Maven AspectJ插件在没有工具的情况下与Java 9一起使用.jar?
这是我的插件定义和版本信息:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.10</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<complianceLevel>1.9</complianceLevel>
<showWeaveInfo>true</showWeaveInfo>
<XnoInline>true</XnoInline>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.0.RC2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.0.RC2</version>
</dependency>
</dependencies>
</plugin>