[GRADLE-2037] Idea & Eclipse plugins do not report missing dependencies Created: 07/Jan/12  Updated: 04/Jan/13  Resolved: 15/Mar/12

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Duplicate Votes: 1


 Description   

In the process of migrating our builds from M3 to M7 I've noticed that both the Eclipse and Idea plugins do not report unresolved dependencies. Because there is no default logging statement, you must inspect the generated .iml or .classpath file to find items that didn't resolve.

For the following build file the logging output for generating the Eclipse classpath is

~master/ideagradle --> gradle eclipse
:cleanEclipseClasspath
:eclipseClasspath
:eclipse

BUILD SUCCESSFUL

However, the generated .classpath file contains

<classpathentry kind="lib" path="/Users/uriah/Dev/java/master/ideagradle/unresolved dependency - foo#bar;1.0.0" exported="true">

The Idea .iml file contains

<CLASSES>
<root url="file://$MODULE_DIR$/unresolved dependency - foo#bar;1.0.0"/>
</CLASSES>

GRADLE-1736 removed the fail fast for unresolved dependencies. I agree with not failing fast, however, an error logging message should be output for each unresolved item. Logging this error will make troubleshooting resolve problem much easier.

Trivial build file with unresolvable dependency:

apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'

repositories {
mavenCentral()
}

dependencies {
compile group: 'javax.servlet', name: 'servlet-api', version: '2.5'
compile group: 'foo', name: 'bar', version: '1.0.0'
}

sourceSets {
main {
java

{ srcDirs = ['src'] }

}
}

tasks.idea {
dependsOn = [ cleanIdeaModule, ideaModule ]
}

tasks.eclipse {
dependsOn = [ cleanEclipseClasspath, eclipseClasspath ]
}



 Comments   
Comment by Nicholas Pace [ 17/Jan/12 ]

I was just bit by this. We are using the STS Gradle plugin. The project itself was annotated with a problem marker, but Gradle did not call out the unresolved dependencies. Probably spent an hour trying to figure out what was wrong, until I looked in the Gradle Dependency Library and saw a link to an unresolved jar.

I know what to look for now when a dependency is not resolved, but it's not intuitive.

Cheers.

Comment by Szczepan Faber [ 15/Mar/12 ]

If Gradle fired a warning would it help?

Also sts guys might provide some nicer feedback in future so understanding the problem should be easier.

Comment by Szczepan Faber [ 15/Mar/12 ]

Duplicate of GRADLE-1945

Generated at Wed Jun 30 12:11:04 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.