Java compilation failing without cause when running with --parallel on gradle > 2.4

We’ve been using gradle for a while for a multi-project build and building in parallel. But after upgrading from 2.4 to 2.10, we started seeing random compilation failures (without any compilation error messages) when running with --parallel. The failures doesn’t appear if run without --parallel. Can this be related to some changes that have been made between 2.4 and 2.10?

There may be some coupling between projects that is done for integration testing, i.e. in an afterEvaluate block, additional task dependencies are created for running the correct jetty project before running integration tests, and also for reporting. But these tasks are separate from compile tasks.

Edit: running gradle with java 1.6.

Edit 2: We found that compiler errors do appear in the logs when building with Gradle 2.4. The errors seem to indicate that a file dependency that has a builtBy <task> is being built while other tasks are executing.

If one project’s evaluation is dependent upon another, you should specify evaluationDependsOn

1 Like

I have to use afterEvaluate {} because of the gretty plugin which creates tasks that I want to add dependencies to/from.

I found the problem. There was another task that deleted the generated file, so gradle is probably innocent in this case.