Issue
After I migrated from building Spring project with Maven to building it with gradle I have weird empty validation errors.
I noticed that path src/main/webapp/WEB-INF/classes
is under Web App Libraries
build path group, though with Maven-import configuration it was just in src directory.
Using gradle cleanEclipse
, refreshing and clearing project, nor removing all .metadata
, .settings
, bin
, .classpath
, .project
directories didn't helped.
Aside from that WAR file is built fine.
Configuration:
//----------------------------------------------------------------------------
// 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 {
...
}
}
What can I do to ensure that project would be imported into Eclipse without this problem?
EDIT:
The only information visible to me is this one:
As far as I noticed project build by maven didn't have any errors and only a little amount of warnings. Right now I see that simple <form:errors path="field"/>
cries about "List being generic".
EDIT2:
I managed to get rid of some of the issues by changing project configuration to:
//----------------------------------------------------------------------------
// SERVER'S PROJECTS' CONFIGURATION
//----------------------------------------------------------------------------
project(':Server') {
eclipse {
project {
natures "org.springframework.ide.eclipse.core.springnature"
buildCommand "org.springframework.ide.eclipse.core.springbuilder"
}
}
}
but the main problem - validation error with no information about what it is concerned - still remains.
Solution
During warning cleanup I decided to remove file src/test/resources/log4j.xml
since it was douplicate of a src/main/resources/log4j.xml
. In that very moment empty validation error disappeared.
If anyone else get similar error, he should try to get rid of all warnings, since apparently they are able to make project fail Eclipse validation.
Answered By - Mateusz Kubuszok