FabricMC / fabric-loom

Gradle build system plugin used to automate the setup of a minecraft mod development environment.
MIT License
223 stars 194 forks source link

Introducing sub projects as dependencies is not supported #1049

Closed huanmeng-qwq closed 4 months ago

huanmeng-qwq commented 4 months ago

repo: https://github.com/huanmeng-qwq/LiteCommands/tree/fabric-support

file

modImplementation(project(":litecommands-fabric"))
> Configure project :examples:fabric
Fabric Loom: 1.5.7

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':examples:fabric'.
> Failed to read metadata from J:\Code\LiteCommands\litecommands-fabric\build\libs\litecommands-fabric-3.3.4+1.20.4.jar, java.nio.file.NoSuchFileException: J:\Code\LiteCommands\litecommands-fabric\build\libs\litecommands-fabric-3.3.4+1.20.4.jar

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':examples:fabric'.
...
Caused by: java.io.UncheckedIOException: Failed to read metadata from J:\Code\LiteCommands\litecommands-fabric\build\libs\litecommands-fabric-3.3.4+1.20.4.jar, java.nio.file.NoSuchFileException: J:\Code\LiteCommands\litecommands-fabric\build\libs\litecommands-fabric-3.3.4+1.20.4.jar
    at net.fabricmc.loom.util.ExceptionUtil.createDescriptiveWrapper(ExceptionUtil.java:45)
    at net.fabricmc.loom.configuration.mods.ModConfigurationRemapper.lambda$supplyModConfigurations$3(ModConfigurationRemapper.java:156)
    at net.fabricmc.loom.configuration.mods.ModConfigurationRemapper.lambda$supplyModConfigurations$4(ModConfigurationRemapper.java:152)
    at net.fabricmc.loom.configuration.mods.ModConfigurationRemapper.supplyModConfigurations(ModConfigurationRemapper.java:141)
    at net.fabricmc.loom.configuration.LoomDependencyManager.handleDependencies(LoomDependencyManager.java:42)
    at net.fabricmc.loom.configuration.CompileConfiguration.lambda$run$1(CompileConfiguration.java:107)
    at net.fabricmc.loom.configuration.CompileConfiguration.lambda$afterEvaluationWithService$6(CompileConfiguration.java:284)
    at net.fabricmc.loom.util.gradle.GradleUtils.lambda$afterSuccessfulEvaluation$0(GradleUtils.java:45)...
    at jdk.proxy1/jdk.proxy1.$Proxy53.afterEvaluate(Unknown Source)
Caused by: java.nio.file.NoSuchFileException: J:\Code\LiteCommands\litecommands-fabric\build\libs\litecommands-fabric-3.3.4+1.20.4.jar
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.<init>(ZipFileSystem.java:166)
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getZipFileSystem(ZipFileSystemProvider.java:125)
    at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:106)
    at net.fabricmc.tinyremapper.FileSystemReference.open(FileSystemReference.java:74)
    at net.fabricmc.tinyremapper.FileSystemReference.openJar(FileSystemReference.java:48)
    at net.fabricmc.tinyremapper.FileSystemReference.openJar(FileSystemReference.java:44)
    at net.fabricmc.loom.util.FileSystemUtil.getJarFileSystem(FileSystemUtil.java:94)
    at net.fabricmc.loom.configuration.mods.ArtifactMetadata.create(ArtifactMetadata.java:55)
    at net.fabricmc.loom.configuration.mods.ModConfigurationRemapper.lambda$supplyModConfigurations$3(ModConfigurationRemapper.java:154)
    ... 185 more

BUILD FAILED in 56s
modmuss50 commented 4 months ago

Please read the wiki page regarding depending on sub projects: https://fabricmc.net/wiki/documentation:fabric_loom#depending_on_sub_projects

You should be using: implementation project(path: ":litecommands-fabric", configuration: "namedElements")