# Build wrong in /subprojects/docs/build.gradle

**URL:** <https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778>\
**Category:** Help/Discuss\
**Created:** [June 6, 2023, 10:44am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778 "2023-06-06T10:44:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sclscldd](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@sclscldd](https://discuss.gradle.org/u/sclscldd)\
**Post date:** [June 6, 2023, 10:44am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/1 "2023-06-06T10:44:43Z")

</div>

I’m tring to build the gradle-8.1.1-src for learning. But when I use the command “./gradlew assemble” I meet the problem:  
 ![image](https://global.discourse-cdn.com/gradle/original/2X/4/464c71d5661972d1f1ed1e1593c9d94f9dfeaaa2.png)  
Also, I’ve added a brief build.gradle file in the root ,and I’d like to know if there’s any error:

```groovy
allprojects {
    tasks.withType(Javadoc).all{
        options.addStringOption('encoding','UTF-8')
    }
    
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

```

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 6, 2023, 12:39pm UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/2 "2023-06-06T12:39:32Z")

</div>

You should probably not add any options to the build.  
Besides that `allprojects { ... }` is highly discouraged anyway,  
by doing `tasks.withType(...).all { ... }` you prevent task configuration avoidance and cause all tasks of that type to be eagerly created and configured.  
The `:docs.javadocAll` task seems to not be properly configured yet to be realized.  
If you use `tasks.withType(...).configureEach { ... }` instead, it will probably work.

Besides that, `assemble` is most probably not what you want.  
Have a look at the `CONTRIBUTING.md` file.

---

<div class="post-metadata">

**Author:** ![sclscldd](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@sclscldd](https://discuss.gradle.org/u/sclscldd)\
**Post date:** [June 7, 2023, 2:05am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/3 "2023-06-07T02:05:39Z")

</div>

Thanks for your reply. I’ll try your advice.  
Because I met the problem earlier that “Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting)” , so I added the option by other’s advice.  
But I’m glad to say that the problem get solved successfully. It have troubled me for a week. I’m really grateful for your solution.  
However, I meet a new error in executing stage:

 ![image](https://global.discourse-cdn.com/gradle/original/2X/d/d99c406f981cb9e3606c6bf2f444bbfdc2a4e4e0.png)

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 7, 2023, 9:50am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/4 "2023-06-07T09:50:31Z")

</div>

Never seen that. Maybe try to `./gradlew --stop` the daemon and try again.  
Looks to me like something is corrupt within the running daemon without having a closer look.

---

<div class="post-metadata">

**Author:** ![sclscldd](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@sclscldd](https://discuss.gradle.org/u/sclscldd)\
**Post date:** [June 7, 2023, 10:02am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/5 "2023-06-07T10:02:37Z")

</div>

OK the first failure disappear. Thanks. But the second "Configuration cache problems found in this build."still exist, detailed question just like:

 ![image](https://global.discourse-cdn.com/gradle/original/2X/a/a5fab79728a4035b8cb661b46a959498cc227722.png)

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [June 7, 2023, 12:40pm UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/6 "2023-06-07T12:40:36Z")

</div>

Again, read the `CONTRIBUTING.md`:

> ### Configuration cache enabled by default
> 
> The build of Gradle enables the configuration cache by default as a dogfooding experiment.
> 
> Most tasks that are used to build Gradle support the configuration cache, but some don’t. For example, building the documentation currently requires you to disable the configuration cache.
> 
> To disable the configuration cache, run the build with `--no-configuration-cache`.
> 
> Tasks known to have problems are listed in the build logic. You can find this list at:
> 
> ```
> build-logic-settings/build-logic-settings-plugin/src/main/kotlin/gradlebuild.internal.cc-experiment.settings.gradle.kts
> 
> ```
> 
> If you discover a task that doesn’t work with the configuration but it not in this list, please add it.
> 
> For more information on the configuration cache, see the [user manual](https://docs.gradle.org/current/userguide/configuration_cache.html).

---

<div class="post-metadata">

**Author:** ![sclscldd](https://avatars.discourse-cdn.com/v4/letter/s/b5ac83/32.png) [@sclscldd](https://discuss.gradle.org/u/sclscldd)\
**Post date:** [June 8, 2023, 1:41am UTC](https://discuss.gradle.org/t/build-wrong-in-subprojects-docs-build-gradle/45778/7 "2023-06-08T01:41:12Z")

</div>

All problems get solved. Thanks for your help 😉
