# Failed to apply plugin \[id 'java'\]

**URL:** <https://discuss.gradle.org/t/failed-to-apply-plugin-id-java/5244>\
**Category:** Old Forum Archive\
**Created:** [February 7, 2015, 6:46am UTC](https://discuss.gradle.org/t/failed-to-apply-plugin-id-java/5244 "2015-02-07T06:46:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghillert](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ghillert/32/669_2.png) [@ghillert](https://discuss.gradle.org/u/ghillert)\
**Post date:** [February 7, 2015, 6:46am UTC](https://discuss.gradle.org/t/failed-to-apply-plugin-id-java/5244/1 "2015-02-07T06:46:00Z")

</div>

Hi,

I encountered a weird issue while upgrading our multi-module Gradle project from ‘1.12’ to ‘2.2.1’. Once updated I get:

```gradle
$ ./gradlew clean
  FAILURE: Build failed with an exception.
  * Where:
Build file '/my-project/spring-integration/build.gradle' line: 54
  * What went wrong:
A problem occurred evaluating root project 'spring-integration'.
> Failed to apply plugin [id 'java']
   > model 'tasks' is finalized

```

Gradle build file:

```gradle
...
subprojects { subproject ->
   apply plugin: 'java'
...

```

It works, once I move the ‘apply’ to here:

```gradle
...
allprojects {
 group = 'org.springframework.integration'
  apply plugin: "java"
...

```

I tested various Gradle versions. It looks like our build is still working with ‘2.0’ but from ‘2.1’ onwards it fails. What is going on here? While I can move the ‘apply java’ to ‘allprojects’ it feels a bit incorrect. I rather like to have it as it is now. What do I miss?

THANKS!

---

<div class="post-metadata">

**Author:** ![Mark\_Viera](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/mark_viera/32/1543_2.png) [@Mark\_Viera](https://discuss.gradle.org/u/Mark_Viera)\
**Post date:** [February 7, 2015, 5:23pm UTC](https://discuss.gradle.org/t/failed-to-apply-plugin-id-java/5244/2 "2015-02-07T17:23:00Z")

</div>

This looks to have been addressed in Gradle 2.3 which should be released early next week.

---

<div class="post-metadata">

**Author:** ![ghillert](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/ghillert/32/669_2.png) [@ghillert](https://discuss.gradle.org/u/ghillert)\
**Post date:** [February 8, 2015, 8:22pm UTC](https://discuss.gradle.org/t/failed-to-apply-plugin-id-java/5244/3 "2015-02-08T20:22:00Z")

</div>

Confirmed - ‘2.3-rc-3’ is addressing the issue. This is timely 🙂 Thanks!
