Skip to content

Commit

Permalink
Fix maven artifacts and publishing. Close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlll08 committed Dec 21, 2021
1 parent 5bd9799 commit e0281b6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
15 changes: 15 additions & 0 deletions Common/build.gradle
@@ -1,6 +1,7 @@
plugins {
id('java')
id('org.spongepowered.gradle.vanilla') version '0.2.1-SNAPSHOT'
id 'maven-publish'
}

archivesBaseName = "${mod_name}-common-${minecraft_version}"
Expand Down Expand Up @@ -32,4 +33,18 @@ processResources {

expand buildProps
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}

repositories {
url "file://" + System.getenv("local_maven")
}
}
11 changes: 5 additions & 6 deletions Fabric/build.gradle
Expand Up @@ -54,15 +54,14 @@ jar {
publishing {
publications {
mavenJava(MavenPublication) {
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}

repositories {
url "file://" + System.getenv("local_maven")
}
}
5 changes: 4 additions & 1 deletion Forge/build.gradle
Expand Up @@ -85,12 +85,15 @@ jar.finalizedBy('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
artifact jar
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
url "file://" + System.getenv("local_maven")
}
}
}
8 changes: 8 additions & 0 deletions build.gradle
Expand Up @@ -44,4 +44,12 @@ subprojects {
it.options.encoding = 'UTF-8'
it.options.release = 17
}

// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {

enabled = false
}
}

0 comments on commit e0281b6

Please sign in to comment.