Fix maven artifacts and publishing. Close #4

This commit is contained in:
Jared 2021-12-21 19:41:15 +02:00
parent 5bd9799a53
commit e0281b6146
No known key found for this signature in database
GPG Key ID: DB3BA3B9088A1BDF
4 changed files with 32 additions and 7 deletions

View File

@ -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}"
@ -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")
}
}

View File

@ -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")
}
}

View File

@ -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")
}
}
}

View File

@ -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
}
}