Skip to content

Neoforged Maven Central Mirror Missing interfaceinjection.json Artifacts #327

@Gu-ZT

Description

@Gu-ZT

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

  1. 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.

  2. 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).

  3. 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.

  4. 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

  1. Create a Gradle project that depends on a library published on Maven Central.
  2. The library contains metadata required for NeoForge interfaces.
  3. Ensure that other artifacts (such as source.jar, javadoc.jar) for the library exist in the maven.neoforged.net mirror.
  4. Run gradle createMinecraftArtifacts.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions