Could not fetch model of type 'IdeaProject' - Strange configuration problem


(Scott Palmer) #1

My project runs fine from the command line, but when the NetBeans Gradle plugin tries to load it, the exception below happens. The odd this is that the configuration problem that it complains about makes no sense.

Module version ca.digitalrapids.kayak:KayakPluginsCoordinator:1.2.1-SNAPSHOT, configuration ‘detachedConfiguration4’ declares a dependency on configuration ‘schema’ which is not declared in the module descriptor for ca.digitalrapids.kayak:KayakCoreModel:1.2.1-SNAPSHOT

But…

kayak:KayakPluginsCoordinator has no mention of the ‘schema’ configuration at all ca.digitalrapids.kayak:KayakCoreModel clearly declares that it has a ‘schema’ configuration: configurations {

schema

javadocs }

I don’t know where “detachedConfiguration4” comes from.

Here is the full stack trace:

Failed to load Gradle project: KayakCoreModel org.gradle.tooling.BuildException: Could not fetch model of type ‘IdeaProject’ using Gradle installation ‘C:\Tools\gradle-1.7’.

at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:55)

at org.gradle.tooling.internal.consumer.async.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:71)

at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:724)

at org.gradle.tooling.internal.consumer.BlockingResultHandler.getResult(BlockingResultHandler.java:46)

at org.gradle.tooling.internal.consumer.DefaultModelBuilder.get(DefaultModelBuilder.java:46)

at org.netbeans.gradle.project.model.GradleModelLoader.getModelWithProgress(GradleModelLoader.java:234)

at org.netbeans.gradle.project.model.GradleModelLoader.getRawModelWithProgress(GradleModelLoader.java:206)

at org.netbeans.gradle.project.model.GradleModelLoader.loadMainModel(GradleModelLoader.java:342)

at org.netbeans.gradle.project.model.GradleModelLoader.loadModelWithProgress(GradleModelLoader.java:412)

at org.netbeans.gradle.project.model.GradleModelLoader.access$200(GradleModelLoader.java:53)

at org.netbeans.gradle.project.model.GradleModelLoader$3.run(GradleModelLoader.java:164)

at org.netbeans.gradle.project.tasks.GradleDaemonManager.runNonBlockingGradleTask(GradleDaemonManager.java:24)

at org.netbeans.gradle.project.tasks.GradleDaemonManager.access$100(GradleDaemonManager.java:14)

at org.netbeans.gradle.project.tasks.GradleDaemonManager$2.run(GradleDaemonManager.java:105)

at org.netbeans.gradle.project.tasks.GradleDaemonManager$3.run(GradleDaemonManager.java:130)

at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)

at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044) Caused by: org.gradle.api.internal.LocationAwareException: Failed to notify model configuration listener.

at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:85)

at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:115)

at org.gradle.initialization.DefaultGradleLauncher.getBuildAnalysis(DefaultGradleLauncher.java:92)

at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.configure(InProcessBuildActionExecuter.java:68)

at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:60)

at org.gradle.tooling.internal.provider.BuildModelAction.run(BuildModelAction.java:32)

at org.gradle.tooling.internal.provider.ConfiguringBuildAction.run(ConfiguringBuildAction.java:108)

at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35)

at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:45)

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:42)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:24)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.StartStopIfBuildAndStop.execute(StartStopIfBuildAndStop.java:33)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.ReturnResult.execute(ReturnResult.java:34)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:70)

at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:68)

at org.gradle.util.Swapper.swap(Swapper.java:38)

at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:68)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:59)

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:45)

at org.gradle.launcher.daemon.server.DaemonStateCoordinator.runCommand(DaemonStateCoordinator.java:186)

at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy.doBuild(StartBuildOrRespondWithBusy.java:49)

at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:34)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.HandleStop.execute(HandleStop.java:36)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.CatchAndForwardDaemonFailure.execute(CatchAndForwardDaemonFailure.java:32)

at org.gradle.launcher.daemon.server.exec.DaemonCommandExecution.proceed(DaemonCommandExecution.java:125)

at org.gradle.launcher.daemon.server.exec.DefaultDaemonCommandExecuter.executeCommand(DefaultDaemonCommandExecuter.java:48)

at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.handleCommand(DefaultIncomingConnectionHandler.java:155)

at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.receiveAndHandleCommand(DefaultIncomingConnectionHandler.java:128)

at org.gradle.launcher.daemon.server.DefaultIncomingConnectionHandler$ConnectionWorker.run(DefaultIncomingConnectionHandler.java:116)

at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:724) Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify model configuration listener.

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:90)

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)

at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)

at com.sun.proxy.$Proxy14.onConfigure(Unknown Source)

at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:148)

at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113)

… 45 more Caused by: org.gradle.listener.ListenerNotificationException: Failed to notify model configuration listener.

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:90)

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:81)

… 50 more Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ‘detachedConfiguration4’.

at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.wrapException(ErrorHandlingArtifactDependencyResolver.java:51)

at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.access$000(ErrorHandlingArtifactDependencyResolver.java:29)

at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver$BrokenResolvedConfiguration.getLenientConfiguration(ErrorHandlingArtifactDependencyResolver.java:127)

at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3465)

at org.codehaus.groovy.runtime.callsite.GetEffectivePojoPropertySite.getProperty(GetEffectivePojoPropertySite.java:61)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)

at org.gradle.plugins.ide.internal.JavadocAndSourcesDownloader.getFiles(JavadocAndSourcesDownloader.groovy:109)

at org.gradle.plugins.ide.internal.JavadocAndSourcesDownloader.this$2$getFiles(JavadocAndSourcesDownloader.groovy)

at org.gradle.plugins.ide.internal.JavadocAndSourcesDownloader$this$2$getFiles.callCurrent(Unknown Source)

at org.gradle.plugins.ide.internal.JavadocAndSourcesDownloader.(JavadocAndSourcesDownloader.groovy:49)

at sun.reflect.GeneratedConstructorAccessor79.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)

at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)

at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.extractRepoFileDependencies(IdeDependenciesExtractor.groovy:73)

at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$extractRepoFileDependencies.call(Unknown Source)

at org.gradle.plugins.ide.idea.model.internal.IdeaDependenciesProvider.getModuleLibraries(IdeaDependenciesProvider.groovy:70)

at sun.reflect.GeneratedMethodAccessor240.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:361)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)

at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)

at org.gradle.plugins.ide.idea.model.internal.IdeaDependenciesProvider$_provide_closure3.doCall(IdeaDependenciesProvider.groovy:45)

at sun.reflect.GeneratedMethodAccessor239.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)

at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)

at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)

at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)

at groovy.lang.Closure.call(Closure.java:412)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:3578)

at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1405)

at org.codehaus.groovy.runtime.dgm$163.invoke(Unknown Source)

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:271)

at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:53)

at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

at org.gradle.plugins.ide.idea.model.internal.IdeaDependenciesProvider.provide(IdeaDependenciesProvider.groovy:44)

at org.gradle.plugins.ide.idea.model.internal.IdeaDependenciesProvider$provide.call(Unknown Source)

at org.gradle.plugins.ide.idea.model.IdeaModule.resolveDependencies(IdeaModule.groovy:302)

at org.gradle.plugins.ide.internal.tooling.IdeaModelBuilder.buildDependencies(IdeaModelBuilder.java:81)

at org.gradle.plugins.ide.internal.tooling.IdeaModelBuilder.build(IdeaModelBuilder.java:72)

at org.gradle.plugins.ide.internal.tooling.IdeaModelBuilder.buildAll(IdeaModelBuilder.java:47)

at org.gradle.plugins.ide.internal.tooling.IdeaModelBuilder.buildAll(IdeaModelBuilder.java:35)

at org.gradle.tooling.internal.provider.BuildModelAction$2.onConfigure(BuildModelAction.java:57)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)

at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)

at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:81)

… 52 more Caused by: java.lang.RuntimeException: Module version ca.digitalrapids.kayak:KayakPluginsCoordinator:1.2.1-SNAPSHOT, configuration ‘detachedConfiguration4’ declares a dependency on configuration ‘schema’ which is not declared in the module descriptor for ca.digitalrapids.kayak:KayakCoreModel:1.2.1-SNAPSHOT

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyToConfigurationResolver.resolveTargetConfigurations(DefaultDependencyToConfigurationResolver.java:46)

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.calculateTargetConfigurations(DependencyGraphBuilder.java:342)

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder$DependencyEdge.attachToTargetConfigurations(DependencyGraphBuilder.java:312)

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.traverseGraph(DependencyGraphBuilder.java:132)

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DependencyGraphBuilder.resolve(DependencyGraphBuilder.java:69)

at org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve(DefaultDependencyResolver.java:76)

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:143)

at org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirectoryStore.java:130)

at org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCacheLockingManager.java:54)

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)

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.getResolvedConfiguration(DefaultConfiguration.java:230)

at sun.reflect.GeneratedMethodAccessor194.invoke(Unknown Source)

… 110 more


(Scott Palmer) #2

Any hints on how to track down the dependency problem woudl be appreciated. Specifically how do I figure out where ‘detachedConfiguration4’ comes from and what the dependency chain is that leads to the ‘schem’ configuration.

Is this likely a result of proejcts in the multi-project build being evaluated in a certain order? I tried to put some “evaluationDependsOn(’:Blah’)” stuff into the projects to force the evaluation of the project with the so-called ‘not declared’ configuration first, but I was unsuccessful.


(Attila Kelemen) #3

I don’t think it is due to different project evaluation order. The configurations should be resolved only after all projects have been evaluated (as of the current release of Gradle).

I would first try to look for ‘detachedConfiguration’ calls and try to find which is the problematic. So, unless it is called inside a plugin, you should be able to locate the detachedConfiguration which fails. Otherwise, it would be good to see the build script (or at least relevant parts).


(Scott Palmer) #4

I never call anything to do with “detachedConfiguration”. I use the java pluging, the newer maven-publish plugin, the Proguard plugin v4.10, and the release plugin v 1.2 from https://github.com/townsfolk/gradle-release (seems to be the best one, and the only one that supports Mercurial)

Digging through all those plugins doesn’t sound like fun.

There are many projects. The only “fancy” things that I do are tweaking the dependency declarations so when building as a sub-project they use project dependencies, but when building standalone (-u) they use regular dependencies from our Artifactory server. And if obfuscation runs I replace the artifact that gets published.


(Attila Kelemen) #5

Can you try temporarily disabling those plugins (except for java) and see if it works without them? This way you can find the offending plugin.


(Attila Kelemen) #6

Also, can you try it with older versions of Gradle? Just type “?VER=1.6” in the “Gradle home” field of the project properties.


(Scott Palmer) #7

I get the same error with ?VER=1.6 (and it did print that it was using the 1.6-bin distribution)

I will try to disable plugins to see if I can narrow it down.


(Scott Palmer) #8

I stripped it down to only the java plugin, with one parent project and 3 sub-projects and the error still occurs. I can email you a tiny zip with the gradle project structure if you like? It seems to be enough to trigger the error. (I use the same username that I am using here at GMail if you want to send me your email without posting it here.)


(Scott Palmer) #9

It seems the problem is caused by a transitive dependency that refers to an older version of the project with the so called undeclared configuration. The older version doesn’t have the configuration or the artifact that it produces - but the newer configuration already referenced as a sibling project should be what is actually used.


(Scott Palmer) #10

This is still happening, it is quite confusing.

Normally all of the relevant dependencies use project dependencies. Gradle should see the configuration declared in the sibling project.


(Attila Kelemen) #11

What do you mean on “see the configuration declared in the sibling project”?


(Scott Palmer) #12

I had solved this problem by excluding a transitive dependency. But then it came back. I think it came back when I flipped to using the ‘maven’ plugin instead of ‘maven-publish’. But now it is even more mysterious: I commented out ALL of the dependencies of the KayakPluginsCoordinator project except for junit (the project is pretty much empty anyway at this point) and it still complains!

Caused by: java.lang.RuntimeException: Module version ca.digitalrapids.kayak:KayakPluginsCoordinator:1.2.1-SNAPSHOT, configuration ‘detachedConfiguration2’ declares a dependency on configuration ‘schema’ which is not declared in the module descriptor for ca.digitalrapids.kayak:KayakCoreModel:1.2.1-SNAPSHOT

Note that is is now “detachedConfiguration2” not “detachedConfiguration4”.

If I run “gradle dependencies” on that project I get this output:

… [bunch of config stuff trimmed out]…

:KayakPluginsCoordinator:dependencies


Project :KayakPluginsCoordinator - KayakPluginsCoordinator


archives - Configuration for archive artifacts.

No dependencies

compile - Compile classpath for source set ‘main’.

No dependencies

default - Configuration for default artifacts.

No dependencies

runtime - Runtime classpath for source set ‘main’.

No dependencies

testCompile - Compile classpath for source set ‘test’.

\— junit:junit:4.10

\— org.hamcrest:hamcrest-core:1.1

testRuntime - Runtime classpath for source set ‘test’.

\— junit:junit:4.10

\— org.hamcrest:hamcrest-core:1.1

BUILD SUCCESSFUL

Total time: 8.584 secs

I can’t for the life of me understand what the heck Gradle is doing with this.


(Scott Palmer) #13

When I had the dependencies they were done this way:

dependencies {

compile project(’:KayakPluginsCache’)

compile project(path: ‘:KayakCoreModel’, configuration: ‘runtime’)

}

I.e. the dependencies are not coming from a repo - they are sibling project in the multi-project build. Gradle should know that the KayakCoreModel project declares a “schema” configuration.


(Scott Palmer) #14

The other thing that comes to mind is HOW do I get the “schema” configuration declared in the “module descriptor” for the project that has that configuration. The module descriptor for this asset would be a pom.xml file… I don’t know how the concept of my “schema” configuration can be expressed in a POM.


(Attila Kelemen) #15

You would have separate artifacts for different configurations (probably with some classifier like “schema”). I’m not sure but I assume the Tooling API is trying to resolve every configuration and some of yours cannot be resolved. Try resolving configurations in a custom task and see which is the problem.


(Scott Palmer) #16

I added this to the root project:

allprojects {

task resolveStuff << {

configurations.each {

println “resolving $it”

println "

files: ${it.resolve()}"

}

}

}

running: “gradle resolveStuff” produces no errors or warnings and prints everything I expected, including the ‘schema’ artifact.


(Attila Kelemen) #17
  • Does this work if the gradle command is executed from within the directories of the subprojects? - Can you open the root project in NetBeans without exceptions? - Can you import it into Idea? - Can you import it into Eclipse?

(Scott Palmer) #18

Command-line gradle works from all directoris with no problems.

Of all the projects (sub-projects and root) there are several that cause the exact same exception. That is, all of the failures complain about this issue with KayakPluginsCoordinator as the root cause. The root project is one of these, but not all projects cause the exception.

I will download Idea and Eclipse to test. I think in both cases though, all gradle does is generate the IDE-specific project files, right? If so I would expect to get the error when generating those files. Particularly when generating files for Idea. I can test that when I get back to a PC.


(Attila Kelemen) #19

I mean importing the project via IDE plugins and not by executing “gradle idea” or “gradle eclipse”. I expect Idea behave the same way. But Eclipse might behave different because it requests ‘EclipseProject’ rather than ‘IdeaProject’.

By the way, I won’t request IdeaProject for Gradle 1.8 and above in the future versions of the plugin. I hope to implement these changes next week, so perhaps that could mitigate the problem. Although, the problem is still strange.


(Scott Palmer) #20

I attempted to import the project into Idea… once I figured out that I had to pick the build.gradle file itself rather than the parent folder it imported the project without any complaints.

Will try Eclipse in a moment…

(I’m reminded why I put up with the quirks and occasional slowness of NetBeans… these other IDEs are so much less user-friendly.)

I did read your comment somewhere (NetBeans JavaOne blog?) about lots of IDE integration changes coming with Gradle 1.8. I will happily test with Gradle 1.8 dev builds when you have something ready.