2014-08-27 99 views
0

同時使用Hibernate的建設我得到這個錯誤gradle這個無法理解的gradle從構建-Xlint一個錯誤:未選中

: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. 

我認爲我需要運行gradle這個與-Xlint選項,但事實證明,我我做錯了。我得到這個錯誤,當我跑

./gradlew eclipse -Xlint:deprecation -Xlint:unchecked Maven settings.xml file did not exist : /home/jsiddharth/.m2/settings.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 

如何運行我的體型忽視的錯誤?

回答

1

對於你的問題,-Xlint是一個Java編譯器選項,與Gradle無關。您可以通過GRADLE_OPTS指定這些選項,這是Gradle如何將參數傳遞給JVM。

具體做法是:GRADLE_OPTS="-Xlint:deprecation"

反正這不是你的麻煩。看一看錯誤:

SingularAttributeJoinTest$2> is not abstract and does not override abstract method integrate(MetadataImplementor,SessionFactoryImplementor,SessionFactoryServiceRegistry) in Integrator return new Integrator() {

你必須在其內部宣佈實行Integrator但未能實現方法integrate,不聲明爲abstract SingularAttributeJoinTest一個匿名類。當然,這種錯誤不能被-Xlint選項所抑制。