[英]How to find the source of an error from Maven animal sniffer plugin?
From my pom.xml
to configure Maven animal sniffer plugin: 从我的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>
(This was borrowed from Google Guava's pom.xml
) (这是从Google Guava的pom.xml
借来的)
Today, I started getting an error from the sniffer plug-in: 今天,我开始从嗅探器插件中收到错误:
[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;
I am not calling CharBuffer.subSequence(...)
directly in my code. 我没有直接在我的代码中调用CharBuffer.subSequence(...)
。 It is likely coming from an included JAR. 它可能来自一个包含的JAR。 How do I find the offending class? 我如何找到有问题的课程?
It is recommended that whenever you have some trouble with Maven run it as follows: 建议每当你遇到麻烦时,请按如下方式运行:
mvn -X clean install
**-X**
option enables you to debug the maven. **-X**
选项使您可以调试maven。 I've also faced the similar issue and found that dependent project is not build using Java 6 version. 我也遇到了类似的问题,发现依赖项目不是使用Java 6版本构建的。 When i build the dependent project using Java 6 then it work fines. 当我使用Java 6构建依赖项目时,它会产生罚款。
So this issue occurred due to Java compliance level. 因此,由于Java合规性级别而发生此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.