Skip to content

Allow multiple copies of a class on the CP and pick the JAR containing the first.#169

Open
shartte wants to merge 1 commit intoneoforged:mainfrom
shartte:allow-multiple-copies
Open

Allow multiple copies of a class on the CP and pick the JAR containing the first.#169
shartte wants to merge 1 commit intoneoforged:mainfrom
shartte:allow-multiple-copies

Conversation

@shartte
Copy link
Contributor

@shartte shartte commented Jun 24, 2024

This allows unusual setups where through cross-project or cross-source-set dependencies, IDEs put MC on the classpath multiple times.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jun 24, 2024

  • Publish PR to GitHub Packages

Last commit published: 5e864b1e2d7c7463e105fb621621c18d1d17b296.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #169' // https://github.com/neoforged/FancyModLoader/pull/169
        url 'https://prmaven.neoforged.net/FancyModLoader/pr169'
        content {
            includeModule('net.neoforged.fancymodloader', 'earlydisplay')
            includeModule('net.neoforged.fancymodloader', 'junit-fml')
            includeModule('net.neoforged.fancymodloader', 'loader')
        }
    }
}

Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

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

I'd prefer the MC jar override to be manual via a system prop. Is that unreasonable? That would better match NG's logic.

@shartte
Copy link
Contributor Author

shartte commented Jun 24, 2024

I'd prefer the MC jar override to be manual via a system prop. Is that unreasonable? That would better match NG's logic.

As I already told you on Discord, no system properties: It's a pain in the ass to actually set those for JUnit runs

@shartte shartte force-pushed the allow-multiple-copies branch from 2c81207 to 5e864b1 Compare June 24, 2024 14:25
@marchermans
Copy link
Member

I'd prefer the MC jar override to be manual via a system prop. Is that unreasonable? That would better match NG's logic.

Yes and no.
This follows NGs logic much better, since NGs logic relies on classpath ordering specifications as defined by Oracle for the JVM --classpath parameter.
The addition of NGs removal and subsequent further modification of the classpath in general is caused by the fact that with duplicates it won't start at all.

@marchermans
Copy link
Member

@Technici4n What is the state on this?
We still need this

@Technici4n
Copy link
Member

In case this got lost: my preference is still to pass the desired MC jar and client-extra as a system prop or something like that.

@neoforged-automation neoforged-automation bot added the needs rebase This Pull Request needs to be rebased before being merged label Sep 22, 2025
@neoforged-automation
Copy link

@shartte, this pull request has conflicts, please resolve them for this PR to move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase This Pull Request needs to be rebased before being merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants