Skip to content

Add the NeoForgedRepositoryFilter to address the issues associated with NeoForge Maven using the Maven Central repository#328

Closed
Gu-ZT wants to merge 3 commits intoneoforged:mainfrom
Gu-ZT:fix/327
Closed

Add the NeoForgedRepositoryFilter to address the issues associated with NeoForge Maven using the Maven Central repository#328
Gu-ZT wants to merge 3 commits intoneoforged:mainfrom
Gu-ZT:fix/327

Conversation

@Gu-ZT
Copy link

@Gu-ZT Gu-ZT commented Mar 19, 2026

Copilot AI review requested due to automatic review settings March 19, 2026 10:26
@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #327 by ensuring Maven Central is prioritized ahead of ModDevGradle-managed repositories, preventing Gradle from “sticking” to the NeoForged Maven Central mirror when some artifact classifiers (e.g., *-interfaceinjection.json) are missing.

Changes:

  • Reorders Maven Central to be inserted before managed repositories during project/settings evaluation.
  • Adds functional tests verifying Maven Central precedes the managed repositories in both project and settings contexts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/main/java/net/neoforged/moddevgradle/internal/RepositoriesPlugin.java Adds Maven Central detection + post-evaluation reordering logic to place it before managed repos.
src/test/java/net/neoforged/moddevgradle/functional/RepositoriesPluginFunctionalTest.java New Gradle TestKit functional coverage to validate repository ordering behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Gu-ZT Gu-ZT force-pushed the fix/327 branch 2 times, most recently from b2567b8 to a67787c Compare March 19, 2026 10:52
@shartte
Copy link
Collaborator

shartte commented Mar 19, 2026

This slows down resolution of our artifacts, so I am not terribly convinced. The more correct solution is to filter the NeoForge repository to serve just our artifacts via content filtering.

@Gu-ZT
Copy link
Author

Gu-ZT commented Mar 19, 2026

This slows down resolution of our artifacts, so I am not terribly convinced. The more correct solution is to filter the NeoForge repository to serve just our artifacts via content filtering.

like this?

repositories.maven(repo -> {
    repo.setName("NeoForged Releases");
    repo.setUrl(URI.create("https://maven.neoforged.net/releases/"));
    repo.content(content -> {
        content.includeGroupByRegex("com\\.google.*");
        content.includeGroupByRegex("net\\.neoforged.*");
        content.includeGroupByRegex("net\\.minecraftforge.*");
        content.includeGroupByRegex("net\\.fabricmc.*");
        content.includeGroupByRegex("net\\.jodah.*");
        content.includeGroupByRegex("org\\.apache.*");
        content.includeGroupByRegex("org\\.codehaus.*");
        content.includeGroup("com.electronwill.night-config");
        content.includeGroup("com.machinezoo.noexception");
        content.includeGroup("cpw.mods");
        content.includeGroup("com.nothome");
        content.includeGroup("de.siegmar");
        content.includeGroup("io.codechicken");
        content.includeGroup("it.unimi.dsi");
        content.includeGroup("net.covers1624");
        content.includeGroup("net.minecrell");
        content.includeGroup("net.sf.jopt-simple");
        content.includeGroup("org.antlr");
        content.includeGroup("org.checkerframework");
        content.includeGroup("org.jetbrains");
        content.includeGroup("org.jline");
        content.includeGroup("org.openjdk.nashorn");
        content.includeGroup("org.ow2.asm");
        content.includeGroup("org.tukaani");
        content.includeGroup("org.vineflower");
        content.includeGroup("trove");
        content.includeModule("io.github.llamalad7", "mixinextras-neoforge");
    });
});

@Gu-ZT Gu-ZT force-pushed the fix/327 branch 9 times, most recently from eaaa595 to 46be846 Compare March 19, 2026 18:52
@Gu-ZT Gu-ZT closed this Mar 19, 2026
@Gu-ZT Gu-ZT changed the title Reorder Maven Central repository to precede managed repositories Add the NeoForgedRepositoryFilter to address the issues associated with NeoForge Maven using the Maven Central repository Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neoforged Maven Central Mirror Missing interfaceinjection.json Artifacts

3 participants