klikli-dev / modonomicon

Data-driven minecraft in-game documentation with progress visualization.
24 stars 10 forks source link

Including Modonomicon causes duplicate modules to be read by java #234

Closed YoItSoul closed 4 months ago

YoItSoul commented 4 months ago

Describe your problem

repositories {

    maven {
        // location of the maven that hosts JEI files since January 2023
        name = "Jared's maven"
        url = "https://maven.blamejared.com/"
    }
    maven {
        // location of a maven mirror for JEI files, as a fallback
        name = "ModMaven"
        url = "https://modmaven.dev"
    }

    maven {
        url "https://dl.cloudsmith.io/public/klikli-dev/mods/maven/"
        content {
            includeGroup "com.klikli_dev"
        }
    }

}

dependencies {

    minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

    implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } }

    compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
    compileOnly "mezz.jei:jei-${mc_version}-forge-api:${jei_version}"
    runtimeOnly "mezz.jei:jei-${mc_version}-forge:${jei_version}"

    implementation "com.klikli_dev:modonomicon-${minecraft_version}-forge:${modonomicon_version}"

}

Causes:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at net.minecraftforge.bootstrap.Bootstrap.bootstrapMain(Bootstrap.java:133)
    at net.minecraftforge.bootstrap.Bootstrap.start(Bootstrap.java:53)
    at net.minecraftforge.bootstrap.ForgeBootstrap.main(ForgeBootstrap.java:19)
Caused by: java.lang.module.ResolutionException: Module minecraft reads more than one module named org.commonmark.ext.gfm.strikethrough
    at java.base/java.lang.module.Resolver.resolveFail(Resolver.java:900)
    at java.base/java.lang.module.Resolver.checkExportSuppliers(Resolver.java:721)
    at java.base/java.lang.module.Resolver.finish(Resolver.java:380)
    at java.base/java.lang.module.Configuration.<init>(Configuration.java:139)
    at java.base/java.lang.module.Configuration.resolveAndBind(Configuration.java:493)
    at SECURE-BOOTSTRAP/cpw.mods.modlauncher@10.2.1/cpw.mods.modlauncher.ModuleLayerHandler.build(ModuleLayerHandler.java:76)
    at SECURE-BOOTSTRAP/cpw.mods.modlauncher@10.2.1/cpw.mods.modlauncher.TransformationServicesHandler.buildTransformingClassLoader(TransformationServicesHandler.java:53)
    at SECURE-BOOTSTRAP/cpw.mods.modlauncher@10.2.1/cpw.mods.modlauncher.Launcher.run(Launcher.java:112)
    at SECURE-BOOTSTRAP/cpw.mods.modlauncher@10.2.1/cpw.mods.modlauncher.Launcher.main(Launcher.java:75)
    at SECURE-BOOTSTRAP/cpw.mods.modlauncher@10.2.1/cpw.mods.modlauncher.BootstrapEntry.main(BootstrapEntry.java:17)
    at net.minecraftforge.bootstrap@2.1.3/net.minecraftforge.bootstrap.Bootstrap.moduleMain(Bootstrap.java:188)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
**Removing the mod inclusion solves this issue. JEI isn't listed as a dependency but your mod wont load without that either.**

System (please complete the following information):

YoItSoul commented 4 months ago
minecraft_version=1.21
mc_version=1.21
modonomicon_version=1.95.2
jei_version=19.3.1.24
klikli-dev commented 4 months ago

Fixed in 803df6a46d88e99e5ca3fc550357e94eb5fe776d