diff --git a/fabric/build.gradle b/fabric/build.gradle index 39157c8cb..6bf99402a 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -100,16 +100,17 @@ publishing { publication.artifactId = rootProject.name + "-" + projectName + "-fabric" project.afterEvaluate { def project = project(":" + projectName) - publication.artifact(project.fakeJar) { classifier null } + def normalArtifact, sourceArtifact + publication.artifact(project.fakeJar) { classifier null; normalArtifact = it } def remapSourcesJarTask = project.remapSourcesJar publication.artifact(remapSourcesJarTask) { builtBy remapSourcesJarTask classifier "sources" + sourceArtifact = it } - // Hack to inherit the dependencies without inheriting the artifacts - publication.setArtifacts(publication.artifacts) from components.java + publication.setArtifacts([normalArtifact, sourceArtifact]) } } } diff --git a/forge/build.gradle b/forge/build.gradle index 811d03a71..9879969ee 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -210,15 +210,16 @@ publishing { project.afterEvaluate { def project = project(":" + projectName) remapSrg.inputFile = project.fakeForgeJar.archiveFile - publication.artifact(remapSrg) { classifier null } + def normalArtifact, sourceArtifact + publication.artifact(remapSrg) { classifier null; normalArtifact = it } publication.artifact(remapSrgSourcesJar) { builtBy remapSrgSourcesJar classifier "sources" + sourceArtifact = it } - // Hack to inherit the dependencies without inheriting the artifacts - publication.setArtifacts(publication.artifacts) from components.java + publication.setArtifacts([normalArtifact, sourceArtifact]) } } } diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 23750177d..17059edcb 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -147,15 +147,16 @@ publishing { project.afterEvaluate { def project = project(":" + projectName) remapMojang.inputFile = project.fakeForgeJar.archiveFile - publication.artifact(remapMojang) { classifier null } + def normalArtifact, sourceArtifact + publication.artifact(remapMojang) { classifier null; normalArtifact = it } publication.artifact(remapMojangSourcesJar) { builtBy remapMojangSourcesJar classifier "sources" + sourceArtifact = it } - // Hack to inherit the dependencies without inheriting the artifacts - publication.setArtifacts(publication.artifacts) from components.java + publication.setArtifacts([normalArtifact, sourceArtifact]) } } }