Attempting to change configuration deprecation warning

After upgrading from gradle 2.3 to 2.4, we started to get the below warnings. If I remove the --refresh-dependencies option, the warning does NOT appear.

Need some help to identify the cause.

It may be related to this task… If I remove it - the warning also does NOT appear. Line 240 appears in the stacktrace below.

task _downloadJavaScriptCompileDependencies(dependsOn: configurations.javaScriptCompile, type: Copy, group: WebPlugin.WEB_GROUP) {
from {
LINE: 240 -> configurations.javaScriptCompile.collect { zipTree(it) }
}
into javaScriptCompileDependenciesDirectory

doFirst { delete javaScriptCompileDependenciesDirectory }

}

gradlew assemble --refresh-dependencies
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
Attempting to change configuration ‘:sec:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:scx:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:scc:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:phl:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:pas:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:ord:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:mrc:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:mom:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:chg:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
Attempting to change configuration ‘:alg:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
:properties:contract:compileJava UP-TO-DATE
Stacktrace related to one of the warnings:
Attempting to change configuration ‘:tst:web:javaScriptCompile’ after it has been included in de
pendency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle
3.0
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.access$100(DefaultConf
iguration.java:48)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$1.validateMutation(Def
aultConfiguration.java:98)
org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultCachePolicy.eachDepen
dency(DefaultCachePolicy.java:70)
org.gradle.api.internal.artifacts.ivyservice.ivyresolve.StartParameterResolutionOverride.add
ResolutionRules(StartParameterResolutionOverride.java:61)
org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolveIvyFactory.create(ResolveIvyF
actory.java:86)
org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execu
te(DefaultDependencyResolver.java:92)
org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver$1.execu
te(DefaultDependencyResolver.java:90)
org.gradle.internal.Transformers$4.transform(Transformers.java:137)
org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyCont
extManager.java:61)
org.gradle.api.internal.artifacts.ivyservice.DefaultIvyContextManager.withIvy(DefaultIvyCont
extManager.java:39)
org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver.resolve
(DefaultDependencyResolver.java:90)
org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver$1.run(Ca
cheLockingArtifactDependencyResolver.java:42)
org.gradle.internal.Factories$1.create(Factories.java:22)
org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:192)
org.gradle.cache.internal.DefaultCacheAccess.useCache(DefaultCacheAccess.java:175)
org.gradle.cache.internal.DefaultPersistentDirectoryStore.useCache(DefaultPersistentDirector
yStore.java:106)
org.gradle.cache.internal.DefaultCacheFactory$ReferenceTrackingCache.useCache(DefaultCacheFa
ctory.java:187)
org.gradle.api.internal.artifacts.ivyservice.DefaultCacheLockingManager.useCache(DefaultCach
eLockingManager.java:64)
org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactDependencyResolver.resolve(
CacheLockingArtifactDependencyResolver.java:40)
org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfRes
olvingDependencyResolver.java:45)
org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsArtifactDependencyResol
ver.resolve(ShortcircuitEmptyConfigsArtifactDependencyResolver.java:58)
org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingArtifactDependencyResolver.resolve
(ErrorHandlingArtifactDependencyResolver.java:47)
org.gradle.api.internal.artifacts.ivyservice.DefaultConfigurationResolver.resolve(DefaultCon
figurationResolver.java:46)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveNow(DefaultConf
iguration.java:263)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfigurati
on(DefaultConfiguration.java:253)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedC
onfiguration(Unknown Source)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileColle
ction.getFiles(DefaultConfiguration.java:465)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getFiles(DefaultConfig
uration.java:218)
org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getFiles(Unk
nown Source)
org.gradle.api.internal.file.AbstractFileCollection.iterator(AbstractFileCollection.java:60)

web_en55ia3usv35hgcmxf33mu0b0$_run_closure6_closure45.doCall(D:\SC\CS-SC-4.01-DEV\gradle\web

.gradle:240)
web_en55ia3usv35hgcmxf33mu0b0$_run_closure6_closure45.doCall(D:\SC\CS-SC-4.01-DEV\gradle\web
.gradle)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(Defau
ltFileCollectionResolveContext.java:112)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTr
ees(DefaultFileCollectionResolveContext.java:75)
org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext$B
uildableFileTreeInternalConverter.convertInto(BuildDependenciesOnlyFileCollectionResolveContext.
java:50)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(Defau
ltFileCollectionResolveContext.java:98)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTr
ees(DefaultFileCollectionResolveContext.java:75)
org.gradle.api.internal.file.CompositeFileCollection$1.resolve(CompositeFileCollection.java:
88)
org.gradle.api.internal.file.CompositeFileTree$FilteredFileTree.resolve(CompositeFileTree.ja
va:91)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveNested(D
efaultFileCollectionResolveContext.java:143)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(Defau
ltFileCollectionResolveContext.java:101)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileTr
ees(DefaultFileCollectionResolveContext.java:75)
org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext$B
uildableFileTreeInternalConverter.convertInto(BuildDependenciesOnlyFileCollectionResolveContext.
java:50)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.doResolve(Defau
ltFileCollectionResolveContext.java:98)
org.gradle.api.internal.file.collections.DefaultFileCollectionResolveContext.resolveAsFileCo
llections(DefaultFileCollectionResolveContext.java:82)
org.gradle.api.internal.file.collections.BuildDependenciesOnlyFileCollectionResolveContext.r
esolveAsBuildables(BuildDependenciesOnlyFileCollectionResolveContext.java:43)
org.gradle.api.internal.file.CompositeFileCollection.addDependencies(CompositeFileCollection
.java:136)
org.gradle.api.internal.file.CompositeFileCollection$3.resolve(CompositeFileCollection.java:
124)
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext$TaskGraphImpl.getNodeValue
s(CachingTaskDependencyResolveContext.java:86)
org.gradle.internal.graph.CachingDirectedGraphWalker$GraphWithEmpyEdges.getNodeValues(Cachin
gDirectedGraphWalker.java:200)
org.gradle.internal.graph.CachingDirectedGraphWalker.doSearch(CachingDirectedGraphWalker.jav
a:112)
org.gradle.internal.graph.CachingDirectedGraphWalker.findValues(CachingDirectedGraphWalker.j
ava:64)
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.doResolve(CachingTaskDepen
dencyResolveContext.java:74)
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.resolve(CachingTaskDepende
ncyResolveContext.java:63)
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTas
kDependencyResolveContext.java:53)
org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.realizedDependencies(DefaultTaskExec
utionPlan.java:181)
org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.addToTaskGraph(DefaultTaskExecutionP
lan.java:138)
org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.addTasks(DefaultTaskGraphExecuter.ja
va:76)
org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBu
ildConfigurationAction.java:47)
org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFil
teringBuildConfigurationAction.java:47)
org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
org.gradle.execution.DefaultBuildExecuter.access$100(DefaultBuildExecuter.java:23)
org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:48)
org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAc
tion.java:44)
org.gradle.execution.DefaultBuildExecuter.configure(DefaultBuildExecuter.java:42)
org.gradle.execution.DefaultBuildExecuter.select(DefaultBuildExecuter.java:35)
org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142
)
org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:106)
org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:86)
org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBu
ildActionExecuter.java:90)
org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.j
ava:28)
org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.j
ava:41)
org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.j
ava:28)
org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:49)
org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.j
ava:37)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger
.java:26)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSi
ngleUsedDaemon.java:34)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)

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

org.gradle.util.Swapper.swap(Swapper.java:38)
org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72

)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.health.DaemonHealthTracker.execute(DaemonHealthTracker.jav
a:47)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:66)
org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvir
onment.java:71)
org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.health.HintGCAfterBuild.execute(HintGCAfterBuild.java:41)
org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.
java:120)
org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespond
WithBusy.java:50)
org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:2
46)
org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolic
y.java:54)
org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)

1 Like

The following is the output of a build script that reproduces the issue - although unlike the actual production build script - the error is intermittent.

gradlew clean assemble --refresh-dependencies
Attempting to change configuration ‘:javaScriptCompile’ after it has been included in dependency
resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle 3.0
:clean
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:_downloadJavaScriptRuntimeDependencies
:_downloadJavaScriptCompileDependencies
:compileJavaScript
compileJavaScript…
:webFrontEndArtifact
:assemble

BUILD SUCCESSFUL

Sample build.gradle:
apply plugin: 'java’
apply plugin: ‘maven-publish’

repositories {
maven {
url “http://host:port/artifactory/repo”;
}
}

publishing {
publications {
java(MavenPublication) {
from components.java
groupId rootProject.name
artifactId = "artifact-id"
version ‘1.0’
}
}
}

ext.javaScriptDependenciesDirectory = "build/dependencies"
ext.javaScriptCompileDependenciesDirectory = "$javaScriptDependenciesDirectory/javaScriptCompile"
ext.javaScriptRuntimeDependenciesDirectory = “$javaScriptDependenciesDirectory/javaScriptRuntime”

sourceSets {
javaScript {
resources {
srcDirs = [
‘src/main/web-static/js’
]
include ‘**/*.js’
}
}
}

configurations {
javaScriptTest.extendsFrom(javaScriptCompile)
webFrontEnd
}

dependencies { javaScriptCompile ‘log4j:log4j:1.2.17’ }

task _downloadJavaScriptCompileDependencies(dependsOn: configurations.javaScriptCompile, type: Copy) {
from {
configurations.javaScriptCompile.collect { zipTree(it) }
}
into javaScriptCompileDependenciesDirectory
}

task _downloadJavaScriptRuntimeDependencies(dependsOn: configurations.javaScriptRuntime, type: Copy) {
from {
configurations.javaScriptRuntime.collect { zipTree(it) }
}
into javaScriptRuntimeDependenciesDirectory
}

task compileJavaScript(dependsOn: [
_downloadJavaScriptCompileDependencies
]) {
doLast { println ‘compileJavaScript…’ }
}

task webFrontEndArtifact(dependsOn: [
_downloadJavaScriptRuntimeDependencies
], type: Zip) {
from compileJavaScript
into(‘js’) { from sourceSets.javaScript.resources }
classifier = ‘webFrontEnd’
}

artifacts { webFrontEnd webFrontEndArtifact }

publishing {
publications {
java(MavenPublication) {
if (webFrontEndArtifact.archivePath.exists()) {
artifact source: webFrontEndArtifact, classifier: ‘webFrontEnd’
}
}
}
}