[GRADLE-2752] Depending on an older version of "self" produces an NPE Created: 16/Apr/13  Updated: 28/Jun/13  Resolved: 28/Jun/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.5
Fix Version/s: 1.7-rc-1

Type: Bug
Reporter: Luke Daley Assignee: Unassigned
Resolution: Fixed Votes: 1


 Description   

build.gradle

group = "org.spockframework"
version = "0.8"

apply plugin: "java"

repositories {
	mavenCentral()
}

dependencies {
	compile "org.spockframework:spock-core:0.7-groovy-2.0"
}

settings.gradle

rootProject.name = "spock-core"

Stacktrace:

Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':compile'.
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:51)
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:41)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultConfigurationResolver.java:42)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConfiguration.java:240)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$900(DefaultConfiguration.java:45)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationResolvableDependencies.getResolutionResult(DefaultConfiguration.java:564)
	at org.gradle.api.tasks.diagnostics.internal.dependencies.AsciiDependencyReportRenderer.render(AsciiDependencyReportRenderer.java:84)
	at org.gradle.api.tasks.diagnostics.DependencyReportTask.generate(DependencyReportTask.java:60)
	at org.gradle.api.tasks.diagnostics.AbstractReportTask.generate(AbstractReportTask.java:67)
	at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:216)
	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:122)
	at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:147)
	at org.gradle.api.tasks.diagnostics.DependencyReportTask_Decorated.invokeMethod(Unknown Source)
	at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:161)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$4.execute(AnnotationProcessingTaskFactory.java:156)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:510)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:499)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:64)
	... 57 more
Caused by: java.lang.NullPointerException
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ConfigurationNode.getArtifacts(DependencyGraphBuilder.java:721)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToParents(DependencyGraphBuilder.java:386)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$ConfigurationNode.attachToParents(DependencyGraphBuilder.java:831)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.assembleResult(DependencyGraphBuilder.java:160)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:72)
	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:78)
	at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:39)
	at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.create(CacheLockingArtifactDependencyResolver.java:37)
	at org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:124)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:130)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:53)
	at org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(CacheLockingArtifactDependencyResolver.java:37)
	at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:41)
	at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResolver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:46)
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve(ErrorHandlingArtifactDependencyResolver.java:39)
	... 74 more


 Comments   
Comment by Adam Murdoch [ 26/Apr/13 ]

So you'd like the compile classpath to resolve to the older version of spock?

Comment by Luke Daley [ 26/Apr/13 ]

This is a contrived example that exhibits the problem.

In the real world it's unlikely that such a relationship is so immediately obvious, so first step is a decent error message.

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