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

Gradle 5.0-rc-1: ComponentSelectionRules.all(Closure) with injection of ComponentMetadata and/or IvyModuleDescriptor has been deprecated #270

Closed
juergenzimmermann opened this issue Nov 4, 2018 · 18 comments · Fixed by #305

Comments

@juergenzimmermann
Copy link

Using Gradle 5.0-rc-1 I get this message: The method ComponentSelectionRules.all(Closure) with injection of ComponentMetadata and/or IvyModuleDescriptor has been deprecated. This is scheduled to be removed in Gradle 6.0. Use the new methods on ComponentSelection instead.

The according stacktrace is:

The method ComponentSelectionRules.all(Closure) with injection of ComponentMetadata and/or IvyModuleDescriptor has been deprecated. This is scheduled to be removed in Gradle 6.0. Use the new methods on ComponentSelection instead.
	at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.ComponentSelectionRulesActionValidator.validate(ComponentSelectionRulesActionValidator.java:37)
	at org.gradle.internal.rules.DefaultRuleActionAdapter.createFromClosure(DefaultRuleActionAdapter.java:39)
	at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultComponentSelectionRules.all(DefaultComponentSelectionRules.java:96)
	at jdk.internal.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.github.benmanes.gradle.versions.updates.Resolver$_addRevisionFilter_closure5$_closure11.doCall(Resolver.groovy:159)
	at jdk.internal.reflect.GeneratedMethodAccessor56.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:411)
	at org.codehaus.groovy.runtime.ConvertedClosure.invokeCustom(ConvertedClosure.java:50)
	at org.codehaus.groovy.runtime.ConversionHandler.invoke(ConversionHandler.java:122)
	at com.sun.proxy.$Proxy65.execute(Unknown Source)
	at org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultResolutionStrategy.componentSelection(DefaultResolutionStrategy.java:201)
	at jdk.internal.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.github.benmanes.gradle.versions.updates.Resolver$_addRevisionFilter_closure5.doCall(Resolver.groovy:158)
	at jdk.internal.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:411)
	at groovy.lang.Closure.call(Closure.java:427)
	at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:70)
	at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
	at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolutionStrategy(DefaultConfiguration.java:923)
	at jdk.internal.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.github.benmanes.gradle.versions.updates.Resolver.addRevisionFilter(Resolver.groovy:157)
	at jdk.internal.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176)
	at com.github.benmanes.gradle.versions.updates.Resolver.createLatestConfiguration(Resolver.groovy:132)
	at jdk.internal.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:176)
	at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.groovy:78)
	at jdk.internal.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates.resolve(DependencyUpdates.groovy:85)
	at jdk.internal.reflect.GeneratedMethodAccessor25.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:184)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveInParallel_closure7$_closure11$_closure12$_closure13.doCall(DependencyUpdates.groovy:76)
	at jdk.internal.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:411)
	at groovy.lang.Closure.call(Closure.java:427)
	at groovyx.gpars.pa.CallClosure.call(CallClosure.java:47)
	at groovyx.gpars.pa.ClosureMapper.op(ClosureMapper.java:36)
	at groovyx.gpars.extra166y.AbstractParallelAnyArray$OOMPap.leafTransfer(AbstractParallelAnyArray.java:2255)
	at groovyx.gpars.extra166y.PAS$FJOMap.atLeaf(PAS.java:258)
	at groovyx.gpars.extra166y.PAS$FJBase.internalCompute(PAS.java:118)
	at groovyx.gpars.extra166y.PAS$FJBase.compute(PAS.java:106)
	at jsr166y.RecursiveAction.exec(RecursiveAction.java:148)
	at jsr166y.ForkJoinTask.doInvoke(ForkJoinTask.java:348)
	at jsr166y.ForkJoinTask.invoke(ForkJoinTask.java:625)
	at jsr166y.ForkJoinPool.invoke(ForkJoinPool.java:1489)
	at groovyx.gpars.extra166y.AbstractParallelAnyArray.allObjects(AbstractParallelAnyArray.java:306)
	at groovyx.gpars.extra166y.ParallelArrayWithMapping.all(ParallelArrayWithMapping.java:141)
	at groovyx.gpars.GParsPoolUtil.collectParallel(GParsPoolUtil.java:495)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:54)
	at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:56)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1235)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveInParallel_closure7$_closure11$_closure12.doCall(DependencyUpdates.groovy:75)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:56)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:127)
	at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy:174)
	at groovyx.gpars.GParsPool$_withExistingPool_closure1.doCall(GParsPool.groovy)
	at jdk.internal.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:411)
	at groovy.lang.Closure.call(Closure.java:405)
	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.access$300(GroovyCategorySupport.java:71)
	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:262)
	at org.codehaus.groovy.runtime.DefaultGroovyMethods.use(DefaultGroovyMethods.java:575)
	at org.codehaus.groovy.runtime.dgm$825.invoke(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:151)
	at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:216)
	at groovyx.gpars.GParsPool.withExistingPool(GParsPool.groovy:173)
	at groovyx.gpars.GParsPool$withExistingPool.call(Unknown Source)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_resolveInParallel_closure7$_closure11.doCall(DependencyUpdates.groovy:74)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
	at groovy.lang.Closure.call(Closure.java:411)
	at groovy.lang.Closure.call(Closure.java:427)
	at groovyx.gpars.pa.CallClosure.call(CallClosure.java:47)
	at groovyx.gpars.pa.ClosureMapper.op(ClosureMapper.java:36)
	at groovyx.gpars.extra166y.AbstractParallelAnyArray$OOMPap.leafTransfer(AbstractParallelAnyArray.java:2255)
	at groovyx.gpars.extra166y.PAS$FJOMap.atLeaf(PAS.java:258)
	at groovyx.gpars.extra166y.PAS$FJBase.compute(PAS.java:108)
	at jsr166y.RecursiveAction.exec(RecursiveAction.java:148)
	at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:305)
	at jsr166y.ForkJoinWorkerThread.execTask(ForkJoinWorkerThread.java:575)
	at jsr166y.ForkJoinPool.scan(ForkJoinPool.java:755)
	at jsr166y.ForkJoinPool.work(ForkJoinPool.java:617)
	at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:369)
@boxheed
Copy link

boxheed commented Feb 3, 2019

This error message also happens when using Gradle 5.1.1

@MartinX3
Copy link

MartinX3 commented Mar 1, 2019

And 5.2.1

@juergenzimmermann
Copy link
Author

And 5.3-rc-3

@Vampire
Copy link
Contributor

Vampire commented Apr 13, 2019

And this will not change until Gradle 6 where the used method will be deleted, so what's the point in listing all the Gradle versions here? o_O

Vampire added a commit to Vampire/gradle-versions-plugin that referenced this issue Apr 13, 2019
@MartinX3
Copy link

To make enough noise that a developer god like you come across and open a pull request @Vampire :P

@Vampire
Copy link
Contributor

Vampire commented Apr 13, 2019

I'm no god and I didn't even hear that noise, just found the issue I fixed already being reported.
Such helpless comments that are only for making noice, like for example also simple "+1" comments instead of using proper voting, usually just annoy as any watcher gets an email and real information floats away.

@MartinX3
Copy link

Then GitHub should implement a Subscription Count.

@Vampire
Copy link
Contributor

Vampire commented Apr 13, 2019

Subscription is not equal to voting, you can also watch what you are against.
Just react with +1 emoji on the initial post. ;-)

@ben-manes
Copy link
Owner

Thanks @Vampire for the PR!

@ljacomet
Copy link

ljacomet commented Aug 6, 2019

Just as an FYI, Gradle 6.0 will be the next version after Gradle 5.6. As expected, this plugin without this change will not run on it.
Any plans on having a release integrating this fix?

I looked for that information elsewhere but could not find it.

@ben-manes
Copy link
Owner

Okay, I kicked off the CI build to release it (automatically on a new release tag).
https://travis-ci.org/ben-manes/gradle-versions-plugin

@Vampire
Copy link
Contributor

Vampire commented Aug 6, 2019

Should we care about the Compilation failed for lines in that builds output?

@Vampire
Copy link
Contributor

Vampire commented Aug 6, 2019

Ok, something else broke too anyway

@ben-manes
Copy link
Owner

hmm, I wonder if it is due to javac 1.8.0_151. TravisCI changed the default OS / jdk, and we were probably on JDK7 before. There might be some incompatibilities, we'd have to debug.

@ben-manes
Copy link
Owner

I can't reproduce the failure locally, so retriggered the CI. It might be a flaky test.

@ben-manes
Copy link
Owner

This time it succeeded. I guess we need to investigate why tests are flaky. They make some external calls (e.g. to Gradle release channel) which might have caused some pain.

@Vampire
Copy link
Contributor

Vampire commented Aug 7, 2019

And the Compilation failed for lines?

@ben-manes
Copy link
Owner

No clue... it might have been an interaction with the buildscan introspection?

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

Successfully merging a pull request may close this issue.

6 participants