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

Forbid dependency resolution at configuration time by default #2298

Open
oehme opened this issue Jun 14, 2017 · 30 comments
Open

Forbid dependency resolution at configuration time by default #2298

oehme opened this issue Jun 14, 2017 · 30 comments
Labels
a:feature A new functionality in:dependency-resolution engine metadata

Comments

@oehme
Copy link
Contributor

oehme commented Jun 14, 2017

After seeing even sophisticated Gradle users stumble over this countless times, I'm convinced that dependency resolution at configuration time should be an error by default. I'm hard pressed to think of any use case for it, but if there is we could allow it with a special method like

allowingExpensiveOperations {
  configuration.files...
}

As a first step we could deprecate resolution at configuration time, pointing users at the user guide and performance guide for an explanation what configuration time is and why resolving dependencies during that phase is wrong. We could encourage them to get in touch in the forum if they think they have a use case that warrants it.

In the next major version we could then turn this into an error. Finally, if there are any good use cases for resolving at configuration time, we could create better APIs to solve those use cases. Then we could even remove the workaround method.

@SUPERCILEX
Copy link
Contributor

@oehme I think this should be reconsidered for 5.0 given that the Kotlin team messed up too: https://youtrack.jetbrains.com/issue/KT-26065.

@JLLeitschuh
Copy link
Contributor

Has this been implemented? I'm seeing a user who let me know they're seeing an error now:

java.lang.RuntimeException: Configuration 'ktlint' was resolved during configuration time.

Is there a separate issue tracking the implementation of this feature which has been completed?

@melix
Copy link
Contributor

melix commented Mar 14, 2019

I'm not aware of such a change, I suspect a plugin is doing this.

@JLLeitschuh
Copy link
Contributor

@melix Heres the issue that caused me to ask this question, apparently the Android plugin is doing this audit now.

JLLeitschuh/ktlint-gradle#219

@Lanchon
Copy link

Lanchon commented Mar 27, 2019

i reported a usage scenario that seems to require early dependency resolution to get any semblance of cleanliness in the code. it's here. or maybe there is something i haven't thought of? thanks!

@emartynov
Copy link

emartynov commented Mar 28, 2019

I'm getting it with gradle 5.4 and AGP 3.4.0-rc2. It looks like it comes from the Android plugin:

java.lang.RuntimeException: Configuration 'debugRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
	at com.android.build.gradle.internal.EarlyDependencyResolutionListener.beforeResolve(DependencyResolutionChecks.kt:74)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.configuration.internal.DefaultListenerBuildOperationDecorator$BuildOperationEmittingInvocationHandler.invoke(DefaultListenerBuildOperationDecorator.java:228)
	at com.sun.proxy.$Proxy36.beforeResolve(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:376)
	at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:358)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:346)
	at org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch.dispatch(DefaultListenerManager.java:333)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy28.beforeResolve(Unknown Source)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.performPreResolveActions(DefaultConfiguration.java:638)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$800(DefaultConfiguration.java:138)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$7.run(DefaultConfiguration.java:583)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphIfRequired(DefaultConfiguration.java:576)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$600(DefaultConfiguration.java:138)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$6.run(DefaultConfiguration.java:556)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry$SafeExclusiveLockImpl.withLock(DefaultProjectStateRegistry.java:244)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveExclusively(DefaultConfiguration.java:552)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:547)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveGraphForBuildDependenciesIfRequired(DefaultConfiguration.java:697)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$3700(DefaultConfiguration.java:138)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationTaskDependency.visitDependencies(DefaultConfiguration.java:1656)
	at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValues(CachingTaskDependencyResolveContext.java:106)
	at org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmptyEdges.getNodeValues(CachingDirectedGraphWalker.java:211)
	at org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.java:121)
	at org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.java:73)
	at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:66)
	at org.gradle.execution.plan.TaskDependencyResolver.resolveDependenciesFor(TaskDependencyResolver.java:46)
	at org.gradle.execution.plan.LocalTaskNode.getDependencies(LocalTaskNode.java:111)
	at org.gradle.execution.plan.LocalTaskNode.resolveDependencies(LocalTaskNode.java:79)
	at org.gradle.execution.plan.DefaultExecutionPlan.addEntryTasks(DefaultExecutionPlan.java:177)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.addEntryTasks(DefaultTaskExecutionGraph.java:139)
	at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:48)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:57)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter$2.proceed(DefaultBuildConfigurationActionExecuter.java:63)
	at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:44)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:57)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter$2.proceed(DefaultBuildConfigurationActionExecuter.java:63)
	at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:47)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:57)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.run(DefaultBuildConfigurationActionExecuter.java:43)
	at org.gradle.internal.Factories$1.create(Factories.java:25)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:132)
	at org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:124)
	at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:39)
	at org.gradle.initialization.DefaultGradleLauncher$CalculateTaskGraph.run(DefaultGradleLauncher.java:333)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.initialization.DefaultGradleLauncher.constructTaskGraph(DefaultGradleLauncher.java:218)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:134)
	at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
	at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
	at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
	at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:31)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
	at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
	at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:50)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:745)

It comes from https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/DependencyResolutionChecks.kt

Do you have direct contact with Google android team?

@melix
Copy link
Contributor

melix commented Mar 28, 2019

There's no way to disable this check from Gradle, this is done in the Android Plugin. I don't think there are a lot of use cases, if any, that require resolution at configuration time. In most cases deferring by using a closure would be enough.

@emartynov
Copy link

I assume it is connected with usage of gradle 5.4 since the same Android plugin works fine on gradle 5.3

@cmwarrington
Copy link

Note that that stacktrace is not a failure, but a warning with stacktrace logged at info, see the line number - turning --info off will lead to the warning not being generate. Sounds like we (the Android Gradle Plugin team) need to update this check for changes in Gradle 5.4, but other than the noise it should not affect the build.

@emartynov
Copy link

Thanks, I have build failed and log is cut on CI and this last messeges, so I intepreted them as a cause but it is not.

Thank you again!

@Alex-Vol-SV
Copy link

For some of my projects #9150 is the primary cause of eager dependency resolution. If that is fixed my dependency resolution is happily working at execution time. I think making this default behavior proposed here is the way to eradicate this problem even from Gradle core itself.

@ericoporto
Copy link

ericoporto commented Jan 21, 2021

See https://github.com/gradle/gradle/issues/2298 is popping up in my gradle run that also has a native part done triggering cmake but I can't tell how to fix looking at it. It's a regular Android Studio made project using the 4.1.1 version (of Android Studio). Reading the top message here doesn't tell me much as to why I am getting it. ./gradlew --version tells me I am on gradle 6.5.

@jjohannes jjohannes removed the @jvm label Mar 22, 2021
@jjohannes jjohannes removed from:member a:chore Minor issue without significant impact labels Mar 30, 2021
@stale stale bot added the stale label Apr 17, 2022
@runningcode runningcode removed the stale label Apr 20, 2022
@OxygenCobalt
Copy link

OxygenCobalt commented Sep 9, 2022

I use afterEvaluate with preDebugBuild.spotlessApply in order to format my code automatically as I'm building it, and I end up getting this error. How should I replace it with a method that does not resolve deps at configuration time?

@esafirm
Copy link

esafirm commented Feb 21, 2023

Hi, I got these warnings after upgrading AGP 7.1.2 to 7.4.1

After checking, the code that trigger this is a dependency substitution rules in our plugin, something like this:

project.configurations.configureEach {
  resolutionStrategy.dependencySubstitution {
    modulesToBeSubstituted.forEach { A ->
      substitute(module(A)).using(project(A))
    }
 }
}

And checking the AGP code to avoid this warning we need to resolve it after task graph is ready.

After wrapping the code above in taskGraph.whenReady the warning is gone and the substitution is working correctly.

Questions:

  1. Why a dependency substitution rules in our plugin triggering a dependency resolution? We have another rules inside a gradle script (*.gradle) but it's working fine
  2. Will there be an issue with adding a substitution rules after task graph ready?
  3. What's the alternative in this case?

Thank you

@johnjohndoe
Copy link

I am getting this warning in my Android application project. How can I fix this?

$ ./gradlew clean aCcc36c3Debug --stacktrace --info

...

> Configure project :network
Evaluating project ':network' using build file 'EventFahrplan/network/build.gradle'.
Using default execution profile
Using Kotlin Gradle Plugin gradle76 variant
Task name matched 'clean'
Abbreviated task name 'aCcc36c3Debug' matched 'assembleCcc36c3Debug'
Selected primary task 'clean' from project :
Selected primary task 'aCcc36c3Debug' from project :
Configuration 'kspCcc36c3DebugKotlinProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See https://github.com/gradle/gradle/issues/2298
Run with --info for a stacktrace.
java.lang.RuntimeException: Configuration 'kspCcc36c3DebugKotlinProcessorClasspath' was resolved during configuration time.

@esafirm
Copy link

esafirm commented Mar 8, 2023

After wrapping the code above in taskGraph.whenReady the warning is gone and the substitution is working correctly.

Actually, this is not true. The change introduced a subtle bug that we decided to revert the change.

For the warning message since it's annoying and making devs hard to read the console, we monkey-patched AGP to remove it.

@phinney
Copy link

phinney commented Mar 10, 2023

I just upgraded to Android Studio 2022.1 patch 2 and upgraded gradle to version 7.5.1. When I rebuilt my project in this new environment I got the following message:

Configuration 'mavenResource' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298

here's the relevant portions of what my build.gradle.kts file looks like:

val mavenResource = configurations.create("mavenResource")

dependencies {
....
mavenResource(some dependency)
}

So that is what appears to me to be what causing this message about the performance and scalability issue that's what got me to this discussion. So "oehme" makes the claim that there is no reason for someone to have a configuration resolved at configuration time. In most situations that's probably true, but there are reasons for doing that. In my case, I add the configuration named "mavenResource". In the dependencies block I add any number of "mavenResource" dependencies. My project also applies a custom plugin that finds the mavenResource configuration and then copies all the files for those resolved dependencies to the projects "resources" directory. It's a very simply handy way to add resources to my project where the resources are stored in a maven repository. My actual dependencies are specified in a toml version file. So if I change the version of a given resource in the toml version file, my project when rebuilt gets the right version of the resource. I claim that's a legitimate use of a configuration time dependency resolution. I'm taking advantage of gradle's mechanism for getting dependency from a repository, not for code library, but for resource objects. What's neat is that it only takes a couple lines of code in a custom plugin to take advantage of this. By disabling this feature, I don't think I have such a nice elegant solution.

Also, when you put together JavaDoc documents, one often needs to add a "javaDoc" configuration so that you can add some additional dependencies for the JavaDoc task. I believe that too, would cause this same warning.

@petertrr
Copy link

I believe, according to the current Gradle best practices it should all be done in a lazy manner. That is, the plugin can still scan all mavenResource configuration but only declare, how these resources should be downloaded, in a form of lambdas wrapped into Providers. The plugin should also register a task, that would download the resources (i.e. execute lambdas of these Providers). Tasks, that require these resources (assembling of JARs, for example), need to be dependent on those resource downloading tasks.

As I understand it, the main motivation behind this restriction is, that you don't need to perform time-consuming operations that are not essential for the build logic itself, but only for the application code.

@denoll72-decode
Copy link

denoll72-decode commented Jun 26, 2023

I have the same problem #2298 =>> capture how to fix it, thanks.

@Dkhusainov
Copy link

Dkhusainov commented Sep 4, 2023

One use case is that I want to quicky see what jar's my classpath resolves to. Previously I could just do hack configurations.runtimeClasspath.files.each { printlnt(it) } in build.gradle and that's it. What do I do now?

@Vampire
Copy link
Contributor

Vampire commented Sep 4, 2023

The same, but wrapped in val foo by tasks.registering { doLast { ... } }?

@ov7a ov7a added the a:feature A new functionality label Sep 5, 2023
@rpconviva
Copy link

rpconviva commented Sep 5, 2023

Any Update on This Issue has it been Resolved by anyone yet?

I am Facing this

in Circle CI

Configure project :app-sdk
VersionName is set to 4.0.9-rc12
CI Job ID is set to 167
VersionName is set to 4.0.9-rc12
CI Job ID is set to 167
VersionName is set to 4.0.9-rc12
CI Job ID is set to 167
VersionName is set to 4.0.9-rc12
CI Job ID is set to 167
WARNING:API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed in version 9.0 of the Android Gradle plugin.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Configuration 'debugCompileClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseCompileClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Cannot publish Ivy descriptor if ivyDescriptor not set in task ':app-sdk:artifactoryPublish' and task 'uploadArchives' does not exist.
Adding "apply plugin: 'java'" or any other plugin extending the 'base' pluginwill solve this issue.
Cannot publish pom for project ':app-sdk' since it does not contain the Maven plugin install task and task ':app-sdk:artifactoryPublish' does not specify a custom pom path.
Configuration(s) specified but the install task does not exist in project :app-sdk.

@mgroth0
Copy link

mgroth0 commented Sep 9, 2023

I have some code that resolves configurations and collects data on which dependencies are used by which others. I do this for every configuration that is marked as isCanBeResolved.

It has always worked perfectly fine, apart from the AGP yelling at me to stop resolving configurations at configuration time.

So I finally listened, and attempted to do it all in a task execution. I basically just have this:

abstract class InspectConfiguration: DefaultTask() {
    @InputFiles
    var configuration: Configuration? = null
    
    @TaskAction
    fun execute() {}
}

However, this is not working with android configurations (configurations provided by the very plugin that was insisting for me to stop resolving at configuration time.) I get errors such as these:

Caused by: org.gradle.internal.component.AmbiguousVariantSelectionException: The consumer was configured to find a library for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common'. However we cannot choose between the following variants of project :k:android:compose:
  - Configuration ':k:android:compose:debugApiElements' variant android-classes-jar declares a library for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm':
      - Unmatched attributes:
          - Provides attribute 'artifactType' with value 'android-classes-jar' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.1.0' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'com.android.build.gradle.internal.attributes.VariantAttr' with value 'debug' but the consumer didn't ask for it
          - Provides attribute 'org.gradle.jvm.environment' with value 'android' but the consumer didn't ask for it
          - Provides its elements packaged as a jar but the consumer didn't ask for it

So the debugApiElements, which has isCanBeResolved set to true, produces this error when the configuration is set as a task input. However, when I just do configuration.resolvedConfiguration at configuration time, I do not get any error with the very same configuration however I do get all of this extreemly long warning output (which also has no way to be supressed.)

How can I correctly add a resolvable android configuration such as debugApiElements to task inputs?

@mgroth0
Copy link

mgroth0 commented Sep 9, 2023

Aparently Configuration as a task input is not configuration cache compatible.

It seems I am caught in the middle. I can't resolve the configuration at configuration time or I will get an un-supressable warning from AGP. However, I also can't add it as a task input to resolve during task execution because it is not configuration cache compatible.

@mgroth0
Copy link

mgroth0 commented Sep 10, 2023

To put my question simply: Is there any possible way at all to call Configuration.getResolvedConfiguration() while:

  1. Not triggering the AGP to produce un-suppressable warnings
  2. Not breaking the configuration cache

@oesolutions
Copy link
Contributor

@mgroth0 In Gradle 7.5 the ability to use dependency resolution results as task inputs was added, which is compatible with the config cache.
https://docs.gradle.org/current/userguide/incremental_build.html#sec:task_input_using_dependency_resolution_results
There is a sample project referenced at the end of that section. Hopefully that's sufficient for your use case.

@aberaud
Copy link

aberaud commented Jan 3, 2024

Not sure if the warning message is meant for final users (app developers) or for developers of various Gradle plugins (ie Google employees working on Android Studio)

I'm hard pressed to think of any use case for it

Just in case, a valuable and useful case for this feature is documented here:
https://developer.android.com/build/dependencies

Please don't remove the feature documented above (freeImplementation etc).

@nemosofts
Copy link

Configure project :app
Configuration 'androidApis' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidJdkImage' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestDebugCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestDebugImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestDebugRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestDebugWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestReleaseCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestReleaseImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestReleaseRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestReleaseWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestUtil' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'androidTestWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'annotationProcessor' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'api' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'archives' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'compileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'coreLibraryDesugaring' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugAnnotationProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugApi' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugApiElements' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugReverseMetadataValues' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugRuntimeElements' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugUnitTestAnnotationProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'debugWearBundling' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'default' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'implementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'lintChecks' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'lintPublish' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseAnnotationProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseApi' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseApiElements' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseReverseMetadataValues' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseRuntimeClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseRuntimeElements' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseUnitTestAnnotationProcessorClasspath' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'releaseWearBundling' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'runtimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testDebugCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testDebugImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testDebugRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testDebugWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesApi' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesDebugApi' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesDebugCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesDebugImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesDebugRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesDebugWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesReleaseApi' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesReleaseCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesReleaseImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesReleaseRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesReleaseWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testFixturesWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testReleaseCompileOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testReleaseImplementation' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testReleaseRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testReleaseWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testRuntimeOnly' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.
Configuration 'testWearApp' was resolved during configuration time.
This is a build performance and scalability issue.
See #2298
Run with --info for a stacktrace.

Task :app:preBuild UP-TO-DATE
Task :app:preReleaseBuild UP-TO-DATE
Task :app:generateReleaseResValues UP-TO-DATE
Task :app:processReleaseGoogleServices UP-TO-DATE
Task :app:mapReleaseSourceSetPaths UP-TO-DATE
Task :app:generateReleaseResources UP-TO-DATE
Task :app:mergeReleaseResources UP-TO-DATE
Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksRelease UP-TO-DATE
Task :app:processReleaseMainManifest UP-TO-DATE
Task :app:processReleaseManifest UP-TO-DATE
Task :app:processApplicationManifestReleaseForBundle UP-TO-DATE
Task :app:checkReleaseAarMetadata UP-TO-DATE
Task :app:packageReleaseResources UP-TO-DATE
Task :app:parseReleaseLocalResources UP-TO-DATE
Task :app:processReleaseManifestForPackage UP-TO-DATE
Task :app:processReleaseResources UP-TO-DATE
Task :app:bundleReleaseResources UP-TO-DATE
Task :app:mergeReleaseShaders UP-TO-DATE
Task :app:compileReleaseShaders NO-SOURCE
Task :app:generateReleaseAssets UP-TO-DATE
Task :app:mergeReleaseAssets UP-TO-DATE
Task :app:checkReleaseDuplicateClasses UP-TO-DATE
Task :app:generateReleaseBuildConfig UP-TO-DATE
Task :app:javaPreCompileRelease UP-TO-DATE
Task :app:compileReleaseJavaWithJavac UP-TO-DATE
Task :app:mergeReleaseArtProfile UP-TO-DATE
Task :app:expandReleaseArtProfileWildcards UP-TO-DATE
Task :app:extractProguardFiles UP-TO-DATE
Task :app:mergeReleaseGeneratedProguardFiles UP-TO-DATE
Task :app:processReleaseJavaRes NO-SOURCE
Task :app:mergeReleaseJavaResource UP-TO-DATE
Task :app:mergeReleaseJniLibFolders UP-TO-DATE
Task :app:mergeReleaseNativeLibs UP-TO-DATE
Task :app:stripReleaseDebugSymbols UP-TO-DATE
Task :app:writeReleaseAppMetadata UP-TO-DATE
Task :app:collectReleaseDependencies UP-TO-DATE
Task :app:configureReleaseDependencies UP-TO-DATE
Task :app:extractReleaseNativeSymbolTables UP-TO-DATE
Task :app:parseReleaseIntegrityConfig UP-TO-DATE
Task :app:validateSigningRelease UP-TO-DATE
Task :app:minifyReleaseWithR8
Task :app:buildReleasePreBundle
Task :app:compileReleaseArtProfile
Task :app:packageReleaseBundle
Task :app:signReleaseBundle
Task :app:produceReleaseBundleIdeListingFile
Task :app:createReleaseBundleListingFileRedirect UP-TO-DATE
Task :app:bundleRelease

BUILD SUCCESSFUL in 2m 9s
42 actionable tasks: 6 executed, 36 up-to-date

Build Analyzer results available

@melix
Copy link
Contributor

melix commented Jan 16, 2024

I'm still unsure why this ticket is still open, but I do get a bunch of notifications so here I am. IMO, this ticket doesn't really make much sense, especially with "modern Gradle". The idea, AFAIK, is to be able at some point to interweave configuration and execution, so that tasks which are configured and ready to execute can start while dependents are still configuring. Even if Gradle is not there yet, the configuration cache already provides improvements going in that direction. I don't think that forbidding dependency resolution at configuration time is, in that context, a good idea. It will certainly break some builds, while not being strictly necessary. I do agree however that for many builds this can be an issue, but that's an inspection which is already available for example in build scans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:dependency-resolution engine metadata
Projects
None yet
Development

No branches or pull requests