Skip to content

Commit

Permalink
Add publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinCodes committed Dec 6, 2023
1 parent 66b77ee commit 71d915f
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.apache.tools.ant.filters.ReplaceTokens

plugins {
id 'java'
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'com.palantir.git-version' version '0.13.0'
}
Expand All @@ -13,15 +14,6 @@ version = projectVersion // `version` might be modified, we don't always want th
description = 'Provides block protection for your server.'
sourceCompatibility = '17'

if (System.getenv("BUILD_NUMBER") != null) {
// Being built in Jenkins, append Build ID
version += "-${System.getenv("BUILD_NUMBER")}"
} else if (!(version ==~ '^[^.]*\\.[^.]*\\.[^.]*$')) { // Thanks https://stackoverflow.com/a/9949200/1709894
// Append the Git hash if 'version' has less than two periods
version += "-${gitVersion()}"
}
logger.info("Building version $version")

repositories {
jcenter()
maven { url = 'https://hub.spigotmc.org/nexus/content/groups/public/' }
Expand Down Expand Up @@ -89,3 +81,22 @@ processResources {
}
})
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

repositories {
maven {
name = "edenReleases"
url = uri("https://sonatype.projecteden.gg/repository/maven-releases/")
credentials {
username "$edenSnapshotsUsername"
password "$edenSnapshotsPassword"
}
}
}
}

0 comments on commit 71d915f

Please sign in to comment.