You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you specify a version range for the NeoForge dependency, NeoGradle fails to resolve dependencies correctly, leading to a broken configuration when you try to build or run the project. As an example, using a freshly cloned version of the MDK with a small modification:
dev@Monica:~/tmp/MDK (main)*$ git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: build.gradle
no changes added to commit (use "git add" and/or "git commit -a")
dev@Monica:~/tmp/MDK (main)*$ git diff
diff --git a/build.gradle b/build.gradle
index 6f1f2ca..a4717ca 100644
--- a/build.gradle
+++ b/build.gradle
@@ -80,7 +80,7 @@ dependencies {
// You can however also use the vanilla plugin (net.neoforged.gradle.vanilla) to use a version of Minecraft without the neoforge loader.
// And its provides the option to then use net.minecraft as the group, and one of; client, server or joined as the module name, plus the game version as version.
// For all intends and purposes: You can treat this dependency as if it is a normal library you would use.
- implementation "net.neoforged:neoforge:${neo_version}"
+ implementation("net.neoforged:neoforge:[20.4,)")
// Example mod dependency with JEI
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
dev@Monica:~/tmp/MDK (main)*$ ./gradlew build
To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/8.1.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build
Path for java installation '/usr/lib/jvm/openjdk-17' (Common Linux Locations) does not contain a java executable
Path for java installation '/usr/lib/jvm/openjdk-16' (Common Linux Locations) does not contain a java executable
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not find any version that matches ng_dummy_ng.net.neoforged:neoforge:[20.4,).
Versions that do not match: [20.4,)
Searched in the following locations:
- file:/home/dev/tmp/MDK/.gradle/repositories/ng_dummy_ng/net/neoforged/neoforge/
- https://libraries.minecraft.net/ng_dummy_ng/net/neoforged/neoforge/
- https://maven.neoforged.net/releases/ng_dummy_ng/net/neoforged/neoforge/maven-metadata.xml
- file:/home/dev/.m2/repository/ng_dummy_ng/net/neoforged/neoforge/
Required by:
project :
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
33 actionable tasks: 1 executed, 32 up-to-date
dev@Monica:~/tmp/MDK (main)*$ ls /home/dev/tmp/MDK/.gradle/repositories/ng_dummy_ng/net/neoforged/neoforge/
'[20.4,)'
Looking at the contents of the [20.4,) folder, there's a neoforge-[20.4,).jar whose manifest appears to match 20.4.48-beta, which suggests the resolution is working correctly, but somewhere the version constraint is getting mangled and reinterpreted as a full version number:
Ideally, NeoGradle should detect that this is a version constraint and use the resolved version, or at the very least it should be documented that version constraints are not supported.
The text was updated successfully, but these errors were encountered:
This also applies to rich versions, which is how I found this bug in the first place (using a strictly/prefer so that i could specify versions in one place and have them flow into my mods.toml cleanly)
If you specify a version range for the NeoForge dependency, NeoGradle fails to resolve dependencies correctly, leading to a broken configuration when you try to build or run the project. As an example, using a freshly cloned version of the MDK with a small modification:
Looking at the contents of the
[20.4,)
folder, there's aneoforge-[20.4,).jar
whose manifest appears to match20.4.48-beta
, which suggests the resolution is working correctly, but somewhere the version constraint is getting mangled and reinterpreted as a full version number:Ideally, NeoGradle should detect that this is a version constraint and use the resolved version, or at the very least it should be documented that version constraints are not supported.
The text was updated successfully, but these errors were encountered: