我在使用gradle构建hibernate时遇到了这个错误
: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
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如何运行我的构建来忽略错误?
发布于 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选项不能抑制这种错误。
https://stackoverflow.com/questions/25521868
复制相似问题