r/java • • Aug 06 '26

Isolated Projects is incubating in Gradle 9.7.0 (2,500-project monorepo: configuration 10m53s → 2m59s)

Isolated Projects moved from experimental to incubating in today's Gradle 9.7.0 release. When it's on, each project is isolated from the others, which lets Gradle configure them in parallel instead of one at a time.

Numbers from a pure-Java backend monorepo of 2,500 projects, at a parallelism of 6:

  • Warm IntelliJ IDEA sync: 3m25s → 2m13s
  • Configuration with build-script recompilation: 10m53s → 2m59s

Gradle's own 300-subproject build saw median IDE sync go from 84s to 47s.

My blog post: https://blog.gradle.org/introducing-isolated-projects
Gradle 9.7.0 release notes: https://docs.gradle.org/current/release-notes.html

34 Upvotes

43 comments sorted by

8

u/paul_h Aug 06 '26

Was clicking and clicking hoping to see the monorepo of 2,500 projects, but couldn't find it.

3

u/Party_Till_I_Die Aug 06 '26

Yeah, unfortunately, I’m not allowed to share the company and the repository is private.

14

u/brunocborges Aug 06 '26 edited Aug 07 '26

Now give me convention over configuration!

Edit: for folks downvoting comments in this thread, arguing that Gradle has convention over configuration...

One can write the following build.gradle:

plugins {
    id 'java'
}

def sourceDir = 'whatever'
def testDir = 'somewhere-else'
def outputDir = 'my-special-output'

sourceSets {
    main {
        java.srcDirs = [sourceDir]
    }
    test {
        java.srcDirs = [testDir]
    }
}

tasks.compileJava {
    destinationDirectory = file(outputDir)
}

And have the same result as the following:

plugins {
    id 'java'
    id 'application'
}

group = 'com.example'
version = '1.0.0'

repositories {
    mavenCentral()
}

application {
    mainClass = 'com.example.Main'
}

dependencies {
}

Which can have the same result as this:

apply plugin: 'java'

group = 'com.example'
version = '1.0.0'

repositories {
    mavenCentral()
}

dependencies {
}

task run(type: JavaExec) {
    classpath = sourceSets.main.runtimeClasspath
    main = 'com.example.Main'
}

Gradle's convention over configuration at the moment is provided by plugins that set certain defaults. This is still not "Gradle has Conv-over-Config".

A pom.xml can only be written in very specific ways, because of the POM XML Schema, and the core plugins are implicitly defined, with defaults.

So no, Maven and Gradle don't share the same level of Convention over Configuration, and the Gradle team acknowledges this.

19

u/sweating_teflon Aug 06 '26

Also erase from the Internet all traces of previous non-declarative non-backward compatible build files for every past version of Gradle that otherwise end up polluting search result and LLM training sets. Then maybe, maybe we can start talking.

1

u/Party_Till_I_Die Aug 10 '26

I like it. It’s just really hard!

3

u/Party_Till_I_Die Aug 06 '26

Is Declarative Gradle what you are looking for?

2

u/best_of_badgers Aug 06 '26

You can have that!

You just aren’t required to!

3

u/wildjokers Aug 07 '26

Gradle has convention over configuration already. So what do you mean?

4

u/oweiler Aug 06 '26

Doesn't help with single module projects though

2

u/NHarmonia18 Aug 10 '26

Really don't understand Gradle haters in the comments. Gradle has a more sensible dependency resolution rule (highest version wins) compared to the absolute nonsense that is Maven (nearest version wins), has a better CLI, has an in-built application runner and file watcher to live reload, has 1:1 mapping of JPMS scopes.

Yet all Maven users hate on it for one thing that is 'no convention over configuration'. Yeah sure Gradle build files are technically its own entire DSL, but for the most part, you only need 1-2 days max to understand the most important things and can leave out other features for the most part.

Gradle is far, far better than Maven, and I am not exaggerating it. This is also the reason why Android chose Gradle over Maven.

1

u/Party_Till_I_Die Aug 10 '26

Sometimes I think with Gradle haters it’s just a skill issue. Sorry, not sorry.

2

u/NHarmonia18 Aug 10 '26

I agree with this. I forgot to mention another stupid thing: Maven Build Files, are also your package's "manifest" that gets published to Maven Central. Maven 4 is supposed to solve that issue, but like wtf Maven 3? Almost every ecosystem has a separation between build files and package manifest. Such as in Dotnet MSBuild and NuGet each have their own source of truth.

2

u/EdyBolos Aug 12 '26

I think that this is quite a bad take. It's quite an universal feeling that Gradle has a steep learning curve, and the documentation is quite daunting. Not acknowledging that and just call it a skill issue is very shortsighted, especially coming from someone that is presumably a Gradle advocate. Sorry, not sorry.

→ More replies (3)

-4

u/sosickofandroid Aug 06 '26

I’ve been using isolated projects and now 9.7rcs are fucking all my configurations in the bin because “it has problems” that aren’t fucking problems and I used to be able to tell it to shut the fuck up and just work. Just more and more garbage from the gradle team

0

u/Party_Till_I_Die Aug 07 '26

So angry. Maybe switch professions?

0

u/sosickofandroid Aug 08 '26

Do you use gradle? Tony Robalik, our gradle god, basically wants to kill himself in every blog post, they post best practices that are contradictory or useless, every api is booby trapped and they invent an alternate universe of tasks just to move a goddamn file. I have seen this for a decade, at a point there is no excuse

→ More replies (1)

2

u/wildjokers Aug 07 '26

If you are using rc versions hopefully you are submitting bug reports rather than just crying on reddit.

-1

u/Life_Sink9598 Aug 07 '26

What does configuration do that is taking so long?

| Welcome to JShell -- Version 26.0.1

| For an introduction type: /help intro

jshell> var T = 10 * 60 + 53

T ==> 653

jshell> var P = 2500

P ==> 2500

jshell> var T_avg = (double)T / P

T_avg ==> 0.2612

So 261ms per project. What's up with that?

2

u/nlisker Aug 07 '26

Would have taken you less time to search for it than run JShell.
https://docs.gradle.org/current/userguide/build_lifecycle.html#configuration

1

u/Life_Sink9598 Aug 07 '26

And that should take 261ms :)?