# New Task Cycle with Gradle 5.6 Nightly

**URL:** https://discuss.gradle.org/t/new-task-cycle-with-gradle-5-6-nightly/32262
**Category:** Help/Discuss
**Created:** [July 2, 2019, 6:47am UTC](https://discuss.gradle.org/t/new-task-cycle-with-gradle-5-6-nightly/32262 "2019-07-02T06:47:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![cdietrich](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cdietrich](https://discuss.gradle.org/u/cdietrich)
#### Post date: [July 2, 2019, 6:47am UTC](https://discuss.gradle.org/t/new-task-cycle-with-gradle-5-6-nightly/32262/1 "2019-07-02T06:47:44Z")

</div>

Hi, we have a custom plugin that works fine up to gradle 5.5 but with the gradle 5.6 nightly it fails

we get an error message like this

```
	FAILURE: Build failed with an exception.

* What went wrong:
Circular dependency between the following tasks:
:classes
\--- :compileJava
     \--- :generateXtext
          \--- :classes (*)

(*) - details omitted (listed previously)

```

i have no idea what could cause this.  
is there any option or hint to find out where in the plugin the cycle is established?

you can find the sample project here:

> **[cdietrich/gradle\_issue\_9674](https://github.com/cdietrich/gradle_issue_9674)**
>
> Reproduces https://github.com/gradle/gradle/issues/9674 - cdietrich/gradle\_issue\_9674

Thanks

---

<div class="post-metadata">

### Author: ![cdietrich](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cdietrich](https://discuss.gradle.org/u/cdietrich)
#### Post date: [July 2, 2019, 7:27am UTC](https://discuss.gradle.org/t/new-task-cycle-with-gradle-5-6-nightly/32262/2 "2019-07-02T07:27:27Z")

</div>

i think i at least have a hint

we do something like that:

```
generatorTask.classesDirs = generatorTask.classesDirs ?: javaSourceSet.output.classesDir

```

and mark

```
@Accessors @Input @Optional FileCollection classesDirs

```

=\> but why is this considered a cycle if we just copy over stuff

maybe it should be

```
generatorTask.classesDirs = generatorTask.classesDirs ?: javaSourceSet.output.dirs

```

but that is not working

=\> how can i read and reuse classesDirs?

---

<div class="post-metadata">

### Author: ![cdietrich](https://avatars.discourse-cdn.com/v4/letter/c/d2c977/32.png) [@cdietrich](https://discuss.gradle.org/u/cdietrich)
#### Post date: [July 2, 2019, 4:30pm UTC](https://discuss.gradle.org/t/new-task-cycle-with-gradle-5-6-nightly/32262/3 "2019-07-02T16:30:29Z")

</div>

i now removed the

```
@Input

```

and it seems to work
