Update buildscripts to support publishing to Maven

This commit is contained in:
thetaqx 2024-02-04 11:21:00 +03:00
parent 17c89ba682
commit c85a333de9
3 changed files with 43 additions and 7 deletions

View File

@ -1,11 +1,47 @@
group 'eu.mivrenik'
version '1.0'
apply plugin: 'java'
apply plugin: 'java-library'
sourceCompatibility = 1.7
repositories {
mavenCentral()
}
def creds = new Properties()
def credsFile = file("credentials.properties")
if (credsFile.exists())
credsFile.withInputStream { creds.load(it) }
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
sourceCompatibility = 1.7
publishing {
repositories {
maven {
name = "funqx gitea"
url = uri("https://git.funqx.org/api/packages/World2Join/maven")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = "token ${creds.getProperty("gitea.token")}"
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}
subprojects {
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
}

View File

@ -13,4 +13,4 @@ repositories {
dependencies {
api project(':stomp')
api 'org.java-websocket:Java-WebSocket:1.3.6'
}
}

View File

@ -7,4 +7,4 @@ sourceCompatibility = 1.7
repositories {
mavenCentral()
}
}