Deprecation warning when using '--offline'

I do have a multi project build. It works pretty OK, but when I start the build using the option “–offline”, then I’ll get error messages like this:

:xxx:compileJava
Attempting to change configuration ':xxx:compile' after it has been included in dependency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle 3.0

It this a known bug? I think I see it since 2.4-rc-1 (or 2). Currently, I’m on 2.4 and I’m getting the error. Shall I try to produce a small example project on github?

Thanks a lot, Uli

Hey Uli,

a small reproducable example would be very helpful to figure out what’s going on here. thanks in adavance!

I’ve created an example, it is fairly compact. You can find it here: https://github.com/uli-heller/uli-gradle/tree/master/e01-offline

The example produces this output without specifying “–offline”:

uli@ulinuc:~/git/uli-gradle/e01-offline$ ./gradlew jar
:a:compileJava UP-TO-DATE
:a:processResources UP-TO-DATE
:a:classes UP-TO-DATE
:a:jar UP-TO-DATE
:util:compileJava UP-TO-DATE
:util:processResources UP-TO-DATE
:util:classes UP-TO-DATE
:util:jar UP-TO-DATE

BUILD SUCCESSFUL

Total time: 4.05 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html

Here is the output when the option “–offline” is used:

uli@ulinuc:~/git/uli-gradle/e01-offline$ ./gradlew --offline jar
:a:compileJava UP-TO-DATE
:a:processResources UP-TO-DATE
:a:classes UP-TO-DATE
:a:jar UP-TO-DATE
:util:compileJava
Attempting to change configuration ':util:compile' after it has been included in dependency resolution. This behaviour has been deprecated and is scheduled to be removed in Gradle 3.0
:util:compileJava UP-TO-DATE
:util:processResources UP-TO-DATE
:util:classes UP-TO-DATE
:util:jar UP-TO-DATE

BUILD SUCCESSFUL

Total time: 3.941 secs

This build could be faster, please consider using the Gradle Daemon: http://gradle.org/docs/2.4/userguide/gradle_daemon.html

Thanks for your help + best regards, Uli

Thanks for the sample project. One thing I needed to do to get your snippet working was to apply the java plugin to the ‘a’ project. I raised GRADLE-3297 for this

Hi Rene,

you’re right with the ‘a’ project - I forgot to push the final commit :frowning:

Thanks a lot, Uli

Likely related:

gradle-2.5-rc-1 seems to fix the issue for me. Thanks a lot!

Uli