从我pom.xml
的配置 Maven 动物嗅探器插件:
<properties>
<animal-sniffer-maven-plugin.version>1.9</animal-sniffer-maven-plugin.version>
</properties>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>${animal-sniffer-maven-plugin.version}</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16-sun</artifactId>
<version>1.0</version>
</signature>
</configuration>
<executions>
<execution>
<id>check-java16-sun</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
(这是从 Google Guava 借来的pom.xml
)
今天,我开始从嗅探器插件中收到错误:
[ERROR] Failed to execute goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.9:check (check-java16-sun) on project Optimus:
Execution check-java16-sun of goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.9:check failed:
An API incompatibility was encountered while executing org.codehaus.mojo:animal-sniffer-maven-plugin:1.9:check:
java.lang.NoSuchMethodError: java.nio.CharBuffer.subSequence(II)Ljava/nio/CharBuffer;
我没有CharBuffer.subSequence(...)
直接在我的代码中调用。它可能来自包含的 JAR。如何找到违规班级?