Task 'xxx' has additional actions that have changed


(Marcin Zajączkowski) #1

I see the message “Task ‘xxx’ has additional actions that have changed” in the build logs. This breaks caching. How can I “debug” that and get know what additional action(s) have changed?


(Sterling Greene) #2

We don’t list the exact set of changes, but that’s referring to any actions added with doFirst or doLast. We detect “additional actions” as changed when the implementation classloader has changed for them.

There are two cases:

  1. If you add actions for tasks in your build.gradle (or similar) files, whenever the files change, we mark those actions as changed.
  2. If you have a plugin that adds actions to tasks defined in a different plugin and your plugin changes, those actions will be seen as changed.

(Marcin Zajączkowski) #3

Thanks for your reply. That’s somehow strange in that case. It’s a Test task and I didn’t modify it in that period.

Can it be triggered by a modification of the project properties (-P or ORG_GRADLE_PROJECT_)?


(Sterling Greene) #4

That shouldn’t make a difference. Are there any plugins that are applied conditionally?


(Marcin Zajączkowski) #5

Rather not.

In the past I had a problem that jvmArgs passed to tests were taken from project.gradle.startParameter.systemPropertiesArgs which was problematic as Jenkins set build parameters with -D, but after switching to -P they seem to be stable.

Is there a way to manually display some information about those actions?


(Sterling Greene) #6

Probably the first thing is to just see how many actions you have and where they come from. So you could register a buildFinished hook to take the Test task and record the number of Task.actions you have (Gradle adds several under the covers) and if you can tell where they come from (either by looking at the classloader or class name).


(Marcin Zajączkowski) #7

It happened a few times a row before I started that thread, but I have problem to reproduce it in new builds. I will come back to that if reoccurred.