Problem Description
When building a Gradle project that uses dependency libraries published on Maven Central, the createMinecraftArtifacts task of ModDevGradle fails because it cannot find the *-interfaceinjection.json file.
Error Message
Execution failed for task ':createMinecraftArtifacts'.
> Could not resolve all files for configuration ':interfaceInjectionData'.
> Could not find anvillib-recipe-neoforge-1.21.1-2.0.0+snapshot.216-interfaceinjection.json (dev.anvilcraft.lib:anvillib-recipe-neoforge-1.21.1:2.0.0+snapshot.216).
Searched in the following locations:
https://maven.neoforged.net/releases/dev/anvilcraft/lib/anvillib-recipe-neoforge-1.21.1/2.0.0+snapshot.216/anvillib-recipe-neoforge-1.21.1-2.0.0+snapshot.216-interfaceinjection.json
> Could not find anvillib-moveable-entity-block-neoforge-1.21.1-2.0.0+snapshot.216-interfaceinjection.json (dev.anvilcraft.lib:anvillib-moveable-entity-block-neoforge-1.21.1:2.0.0+snapshot.216).
Searched in the following locations:
https://maven.neoforged.net/releases/dev/anvilcraft/lib/anvillib-moveable-entity-block-neoforge-1.21.1/2.0.0+snapshot.216/anvillib-moveable-entity-block-neoforge-1.21.1-2.0.0+snapshot.216-interfaceinjection.json
Root Cause
maven.neoforged.net has created a mirror of Maven Central, but the mirror has not fully synchronized all files, particularly missing specific artifact files such as interfaceinjection.json.
Key Issue
When maven.neoforged.net finds other required files for the library (such as source.jar, javadoc.jar), Gradle considers the repository to have successfully obtained all artifacts for that dependency and will not search other repositories for the missing *-interfaceinjection.json file.
This leads to build failures because the interfaceinjection configuration files required by ModDevGradle cannot be retrieved, even though these files exist on Maven Central.
Affected Dependencies
dev.anvilcraft.lib:anvillib-recipe-neoforge-1.21.1:2.0.0+snapshot.216
dev.anvilcraft.lib:anvillib-moveable-entity-block-neoforge-1.21.1:2.0.0+snapshot.216
Suggested Solutions
-
Improve interfaceInjectionData Repository Configuration: ModDevGradle should configure an independent repository resolution strategy for interfaceinjection data, unaffected by the resolution results of other artifacts. Even if a repository successfully finds other artifacts (such as source.jar), it should continue searching for missing interfaceinjection.json files in other configured repositories.
-
Add Repository Fallback Mechanism: Implement a fallback strategy where if interfaceinjection.json is missing from the preferred repository (maven.neoforged.net), it should automatically attempt to retrieve it from other configured repositories (such as Maven Central).
-
Enhance Mirror Synchronization: Ensure that the mirror of Maven Central on maven.neoforged.net is completely synchronized, including all artifact file types, especially *-interfaceinjection.json files.
-
Clarify Documentation: Clearly state in the project documentation the resolution rules for different artifact files in dependency libraries published via Maven Central.
Steps to Reproduce
- Create a Gradle project that depends on a library published on Maven Central.
- The library contains metadata required for NeoForge interfaces.
- Ensure that other artifacts (such as source.jar, javadoc.jar) for the library exist in the maven.neoforged.net mirror.
- Run
gradle createMinecraftArtifacts.
- Observe that the task fails because it cannot find the
*-interfaceinjection.json file, even though the file exists on Maven Central.
Environment Information
- AnvilLib Version: 2.0.0+snapshot.216
- Minecraft Version: 1.21.1
- NeoForge Version: 21.1.219.
- ModDevGradle Version: 2.0.140.
Problem Description
When building a Gradle project that uses dependency libraries published on Maven Central, the
createMinecraftArtifactstask of ModDevGradle fails because it cannot find the*-interfaceinjection.jsonfile.Error Message
Root Cause
maven.neoforged.nethas created a mirror of Maven Central, but the mirror has not fully synchronized all files, particularly missing specific artifact files such asinterfaceinjection.json.Key Issue
When maven.neoforged.net finds other required files for the library (such as
source.jar,javadoc.jar), Gradle considers the repository to have successfully obtained all artifacts for that dependency and will not search other repositories for the missing*-interfaceinjection.jsonfile.This leads to build failures because the interfaceinjection configuration files required by ModDevGradle cannot be retrieved, even though these files exist on Maven Central.
Affected Dependencies
dev.anvilcraft.lib:anvillib-recipe-neoforge-1.21.1:2.0.0+snapshot.216dev.anvilcraft.lib:anvillib-moveable-entity-block-neoforge-1.21.1:2.0.0+snapshot.216Suggested Solutions
Improve interfaceInjectionData Repository Configuration: ModDevGradle should configure an independent repository resolution strategy for interfaceinjection data, unaffected by the resolution results of other artifacts. Even if a repository successfully finds other artifacts (such as source.jar), it should continue searching for missing interfaceinjection.json files in other configured repositories.
Add Repository Fallback Mechanism: Implement a fallback strategy where if interfaceinjection.json is missing from the preferred repository (maven.neoforged.net), it should automatically attempt to retrieve it from other configured repositories (such as Maven Central).
Enhance Mirror Synchronization: Ensure that the mirror of Maven Central on
maven.neoforged.netis completely synchronized, including all artifact file types, especially*-interfaceinjection.jsonfiles.Clarify Documentation: Clearly state in the project documentation the resolution rules for different artifact files in dependency libraries published via Maven Central.
Steps to Reproduce
gradle createMinecraftArtifacts.*-interfaceinjection.jsonfile, even though the file exists on Maven Central.Environment Information