SpongePowered / VanillaGradle

A toolchain for Minecraft: Java Edition that builds a workspace to interact with the game using the official mappings provided to the public by Mojang Studios.
MIT License
86 stars 18 forks source link

Fix "Forcibly retrieve lwjgl from libraries.minecraft.net" cause `FAILURE: Build failed with an exception` with Gradle 7.6.4 #150

Closed MarkusBordihn closed 2 weeks ago

MarkusBordihn commented 2 weeks ago

Its seems that https://github.com/SpongePowered/VanillaGradle/commit/ccc45765d9881747b2c922be7a13c453c32ce9ed is causing a FAILURE: Build failed with an exception: void org.gradle.api.artifacts.repositories.InclusiveRepositoryContentDescriptor.includeGroupAndSubgroups(java.lang.String)' with Gradle 7.6.4 and lower.

Relevant debug part:

2024-06-17T20:47:47.876+0200 [INFO] [org.spongepowered.gradle.vanilla.internal.repository.MinecraftProviderService] VanillaGradle: Shutting down MinecraftProviderService
2024-06-17T20:47:47.876+0200 [DEBUG] [org.apache.hc.client5.http.impl.async.AbstractHttpAsyncClientBase] Shutdown GRACEFUL
2024-06-17T20:47:47.878+0200 [DEBUG] [org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager] Shutdown connection pool GRACEFUL
2024-06-17T20:47:47.878+0200 [DEBUG] [org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManager] Connection pool shut down
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] A problem occurred configuring project ':Common'.
2024-06-17T20:47:47.887+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Failed to notify project evaluation listener.
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]    > 'void org.gradle.api.artifacts.repositories.InclusiveRepositoryContentDescriptor.includeGroupAndSubgroups(java.lang.String)'
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --scan to get full insights.
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
2024-06-17T20:47:47.888+0200 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
2024-06-17T20:47:47.889+0200 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
2024-06-17T20:47:47.889+0200 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 6s

Relevant code part:

            repositories.exclusiveContent(exc -> {
                exc.forRepositories(mojang)
                    .filter(conf -> {
                        conf.includeGroupAndSubgroups("org.lwjgl");
                        conf.includeGroupAndSubgroups("com.mojang");
                    });
            });

According https://docs.gradle.org/current/kotlin-dsl/gradle/org.gradle.api.artifacts.repositories/-inclusive-repository-content-descriptor/include-group-and-subgroups.html includeGroupAndSubgroups is a feature of Gradle 8.1.

This means that this change will break most of Minecraft versions like 1.18.2 and 1.19.2 which requires Gradle 7.x and using the '0.2.1-SNAPSHOT'.

It would be great to create a separate stable version e.g. 0.2.1-stable without this fix, to maintenance compatibility with 1.18.2 and 1.19.2 build scripts.

zml2008 commented 2 weeks ago

update gradle lol

MarkusBordihn commented 2 weeks ago

update gradle lol

Updating Gradle is straightforward if you are only using VanillaGradle. However, for existing multi-loader templates, such as the ones available at MultiLoader-Template (examples), it can be more complex. These templates often have dependencies that specifically require Gradle 7.x.

It appears that this project does not prioritize long-term legacy support and considers implementing breaking changes without a major version number update as standard practice.

gabizou commented 2 weeks ago

It appears that this project does not prioritize long-term legacy support and considers implementing breaking changes without a major version number update as standard practice.

For your edification, this plugin is still in 0.x lifecycle, meaning that any and all breaking changes that are stipulated by Gradle's version support is always necessary. We're a small open source organization that has limited time to support a few minor versions of Gradle, we don't have the luxury of providing support for multiple major versions of Gradle.

By no means is it our obligation to provide support for a major version that has already ended public support, and a minor version that was last patched over a year ago (Gradle 7 is EOL, and Gradle 8.1 was released in April 2023).