FabricMC / fabric-loom

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

Sources for Minecraft libraries wont download after the latest intelij update. #1032

Closed modmuss50 closed 8 months ago

modmuss50 commented 8 months ago

The latest intelij update has broken downloading the sources of libraries hosted on Mojang's maven server. This is because Gradle/Intelij try to download the sources from the same maven repo that provided the library jar. Mojang does not rehost the -sources.jar.

Possible workarounds that loom can do:

Error:

Execution failed for task ':ijDownloadSourcesfaba6315-16b'.
> Could not resolve all files for configuration ':downloadSources_ad226566-b906-41d1-9ef1-493a9f235be4'.
   > Could not find fastutil-8.5.12-sources.jar (it.unimi.dsi:fastutil:8.5.12).
     Searched in the following locations:
         https://libraries.minecraft.net/it/unimi/dsi/fastutil/8.5.12/fastutil-8.5.12-sources.jar

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
modmuss50 commented 8 months ago

A workaround for this is to add maven central as an artifact url like so:

repositories.named("Mojang", MavenArtifactRepository) {
    artifactUrls ArtifactRepositoryContainer.MAVEN_CENTRAL_URL
}

Loom should do the same when registering the Mojang repo.