首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法理解gradle build -Xlint:unchecked中的错误

无法理解gradle build -Xlint:unchecked中的错误
EN

Stack Overflow用户
提问于 2014-08-27 08:00:49
回答 1查看 1.7K关注 0票数 1

我在使用gradle构建hibernate时遇到了这个错误

代码语言:javascript
复制
:hibernate-entitymanager:compileTestJava
/home/jsiddharth/workspace/hibernate-orm-master/hibernate-entitymanager/src/test/java/org/hibernate/jpa/test/criteria/paths/SingularAttributeJoinTest.java:128: error: <anonymous org.hibernate.jpa.test.criteria.paths.SingularAttributeJoinTest$2> is not abstract and does not override abstract method integrate(MetadataImplementor,SessionFactoryImplementor,SessionFactoryServiceRegistry) in Integrator
        return new Integrator() {
                                ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:hibernate-entitymanager:compileTestJava FAILED

FAILURE: Build failed with an exception.

我以为我需要使用-Xlint选项运行gradle,但结果是,我做错了。我跑的时候出了这个错误

./gradlew -Xlint:deprecation -Xlint:unchecked Maven settings.xml文件不存在:/home/jsiddharth/.m2/setings.xml

代码语言:javascript
复制
FAILURE: Build failed with an exception.

* What went wrong:
Problem configuring task :eclipse from command line. Unknown command-line option '-X'.
> Unknown command-line option '-X'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 16.185 secs

如何运行我的构建来忽略错误?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-27 08:24:42

至于您的问题,-Xlint是一个Java编译器选项,与Gradle无关。您可以通过GRADLE_OPTS指定这些选项,这就是Gradle将参数传递给JVM的方式。

具体来说:GRADLE_OPTS="-Xlint:deprecation"

不管怎样,这不是你的麻烦。请看一下错误:

SingularAttributeJoinTest$2>不是抽象的,也不覆盖Integrator中的抽象方法集成(MetadataImplementor、SessionFactoryImplementor、SessionFactoryServiceRegistry)返回新的Integrator() {

SingularAttributeJoinTest中有一个匿名类,该类被声明为实现Integrator,但未能实现方法integrate,且未声明为抽象。当然,-Xlint选项不能抑制这种错误。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25521868

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档