Skip to content

Commit

Permalink
update maven publishing gradle definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mezz committed Aug 23, 2021
1 parent 6c306dc commit 6bb06c8
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions build.gradle
Expand Up @@ -21,6 +21,7 @@ plugins {
id 'java'
id 'eclipse'
id 'idea'
id "maven-publish"
id "com.diffplug.spotless" version "5.14.3"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.71.4'
Expand Down Expand Up @@ -221,20 +222,20 @@ task reobf {
dependsOn reobfApiJar
}

task publish(dependsOn: build) {
description = 'Publishes JARs to local maven'
if (project.hasProperty('local_maven')) {
apply plugin: 'maven-publish'
publishing {
publications { PublicationContainer publicationContainer ->
publicationContainer.register("maven", MavenPublication) { MavenPublication publication ->
publication.artifacts = [apiJar, jar, javadocJar, deobfJar, sourcesJar]
}
}
repositories {
maven {
url("file://${local_maven}")
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact apiJar
artifact jar
artifact javadocJar
artifact deobfJar
artifact sourcesJar
}
}
repositories {
if (project.hasProperty('local_maven')) {
maven {
url("file://${local_maven}")
}
}
}
Expand Down

0 comments on commit 6bb06c8

Please sign in to comment.