2013-03-13 26 views
1

我从Maven构建Spring项目迁移到使用Gradle构建它之后,我有奇怪的空验证错误。'Gradle eclipse'后Spring项目中的空验证消息

我注意到路径src/main/webapp/WEB-INF/classes是在Web App Libraries构建路径组,但使用Maven-import配置它只是在src目录中。

使用gradle cleanEclipse,清新和结算项目,也没有删除所有.metadata.settingsbin.classpath.project目录没有帮助。

除了该WAR文件构建好。

配置:

//---------------------------------------------------------------------------- 
//      SERVER'S TASKS' CONFIGURATION 
//---------------------------------------------------------------------------- 

configure(serverProjects) { 
    apply plugin : 'war' 
    apply plugin : 'eclipse-wtp' 

    sourceCompatibility = 1.7 
    targetCompatibility = 1.7 
} 

project(':Server') { 
    war { 
     destinationDir serverDir 
    } 
} 

... 

//---------------------------------------------------------------------------- 
//      SERVER'S PROJECTS' CONFIGURATION 
//---------------------------------------------------------------------------- 

project(':Server') { 
    eclipse {  
     project { 
      natures "com.springsource.sts.gradle.core.nature" 
     } 

     classpath { 
      containers "com.springsource.sts.gradle.classpathcontainer" 
     } 
    } 
} 

... 

//---------------------------------------------------------------------------- 
//     SERVER'S DEPENDENCIES' CONFIGURATION 
//---------------------------------------------------------------------------- 

configure(serverProjects) { 
    repositories { 
     mavenCentral() 
     maven { url 'https://repository.jboss.org/nexus/content/groups/public' } 
    } 
} 

project(':Server') { 
    dependencies { 
     ... 
    } 
} 

我能做些什么,以确保项目将被导入到Eclipse中没有这个问题?

编辑:

我看到的唯一信息是这一个:empty validation error http://img689.imageshack.us/img689/2682/vaildationerror.png

至于我的行家注意到,项目生成没有任何错误,只是警告少量。现在我看到简单的<form:errors path="field"/>有关“List is generic”的呼喊。

EDIT2:

我设法通过改变项目配置摆脱一些问题:

//---------------------------------------------------------------------------- 
//      SERVER'S PROJECTS' CONFIGURATION 
//---------------------------------------------------------------------------- 

project(':Server') { 
    eclipse {  
     project { 
      natures  "org.springframework.ide.eclipse.core.springnature" 
      buildCommand "org.springframework.ide.eclipse.core.springbuilder" 
     } 
    } 
} 

但主要问题 - 没有什么是有关信息验证错误 - 仍遗迹。

+0

你能更详细地描述问题是什么吗? Eclipse错误日志中是否有任何有用的信息? – 2013-03-13 18:41:49

+0

我在问题描述中添加了一些细节。 – 2013-03-13 22:06:40

回答

2

在警告清理期间,我决定删除文件src/test/resources/log4j.xml,因为它是src/main/resources/log4j.xml的一倍。在那一刻,空的验证错误消失了。

如果其他人得到类似的错误,他应该尝试摆脱所有警告,因为显然他们能够使项目无法验证Eclipse。

8

我有同样的问题(我认为)。我通过右键单击项目并选择“验证”来解决此问题。这将重新执行验证并清除错误。

+0

对我来说,这样做可以消除一个项目中的错误,但不会导致错误。对于这个其他项目,它说“验证已完成,发现了一个错误”,但_still_没有说明错误是什么。奇。 – Vasan 2015-05-08 05:15:30

+0

它为我工作....很好 – 2016-02-04 05:06:54