Skip to content

Commit

Permalink
Fix publishing to maven
Browse files Browse the repository at this point in the history
  • Loading branch information
MineGame159 committed Oct 10, 2023
1 parent 1ceea3e commit 3872a8e
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ plugins {
id "com.github.johnrengelman.shadow" version "8.1.1"
}

sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
version = project.mod_version + (project.hasProperty("devbuild") ? ("-" + project.findProperty("devbuild")) : "")
group = project.maven_group
Expand Down Expand Up @@ -113,6 +111,13 @@ jar {
}
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

withSourcesJar()
}

remapJar {
dependsOn shadowJar
inputFile.set(shadowJar.archiveFile)
Expand All @@ -123,33 +128,22 @@ javadoc {
options.encoding = "UTF-8"
}

task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set("sources")
from sourceSets.main.allSource
tasks.register("javadocJar", Jar) {
from javadoc
archiveClassifier.set("javadoc")
}

task javadocJar(type: Jar) {
archiveClassifier.set("javadoc")
from javadoc
build {
dependsOn javadocJar
}

publishing {
publications {
java(MavenPublication) {
mavenJava(MavenPublication) {
artifactId = "meteor-client"
version = project.hasProperty("devbuild") ? (project.mod_version + "-SNAPSHOT") : project.mod_version

artifact(remapJar) {
builtBy remapJar
}

artifact(sourcesJar) {
builtBy remapSourcesJar
}

artifact(javadocJar) {
builtBy javadocJar
}
from components.java
}
}

Expand Down

0 comments on commit 3872a8e

Please sign in to comment.