Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of java.lang.IllegalStateExceptions logged with Gradle 3.4-rc-1 #125

Closed
jochenberger opened this issue Jan 27, 2017 · 4 comments
Closed

Comments

@jochenberger
Copy link
Collaborator

When running the dependencyUpdates task with Gradle 3.4, I get a lot of log output:

Failed to resolve ::apiElements
Failed to resolve ::implementation
Failed to resolve ::runtimeElements
Failed to resolve ::runtimeOnly
Failed to resolve ::testImplementation
Failed to resolve ::testRuntimeOnly

When running with -i, the stacktraces are logged too:

Failed to resolve ::apiElements
java.lang.IllegalStateException: Resolving configuration 'apiElementsCopy' directly is not allowed
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.assertResolvingAllowed(DefaultConfiguration.java:818)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:419)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:414)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:62)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:213)
        at org.gradle.internal.metaobject.BeanDynamicObject.getProperty(BeanDynamicObject.java:156)
        at org.gradle.internal.metaobject.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:55)
        at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:60)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:50)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
        at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.groovy:64)
        at com.github.benmanes.gradle.versions.updates.Resolver$resolve.call(Unknown Source)
        at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_run_closure2$_closure8.doCall(DependencyUpdates.groovy:60)
[...]

Not sure what changed inside Gradle, but I guess there needs to be an additional check as to whether the current configuration is "internal".

@ben-manes
Copy link
Owner

ben-manes commented Jan 29, 2017

From Gradle's source code, it appears that we should filter the configurations by checking isCanBeResolved() first.

@ben-manes
Copy link
Owner

Or it may be that we want to resolve them, since they appear to be api/impl separations. If a clone and setCanBeResolved(true) works, we'd bypass this issue without degrading the report.

@jochenberger
Copy link
Collaborator Author

The configurations come from the new java-library plugin in Gradle 3.4: https://docs.gradle.org/3.4-rc-1/userguide/userguide_single.html#sec:java_library_configurations_graph
I had a glance at the docs there, but I guess I'm not entirely awake yet. But I guess that trying to resolve the copy is probably a good idea.

@jochenberger
Copy link
Collaborator Author

Closing in favor of #131

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants