mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 17:17:37 +00:00
publish both artifacts
This commit is contained in:
parent
36877ae2f2
commit
ead38212d5
@ -2,8 +2,9 @@ plugins {
|
|||||||
id 'java'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'dev.plex'
|
group = rootProject.group
|
||||||
version '1.1-SNAPSHOT'
|
version = rootProject.version
|
||||||
|
description = "Plex-API"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
55
build.gradle
Normal file
55
build.gradle
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
plugins {
|
||||||
|
id "java"
|
||||||
|
id "maven-publish"
|
||||||
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||||
|
}
|
||||||
|
|
||||||
|
group = "dev.plex"
|
||||||
|
version = "1.1-SNAPSHOT"
|
||||||
|
description = "Plex"
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven(MavenPublication) {
|
||||||
|
pom.withXml {
|
||||||
|
def dependenciesNode = asNode().appendNode("dependencies")
|
||||||
|
configurations.getByName("library").getAllDependencies().each { dependency ->
|
||||||
|
dependenciesNode.appendNode("dependency").with {
|
||||||
|
it.appendNode("groupId", dependency.group)
|
||||||
|
it.appendNode("artifactId", dependency.name)
|
||||||
|
it.appendNode("version", dependency.version)
|
||||||
|
it.appendNode("scope", "provided")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
configurations.getByName("implementation").getAllDependencies().each { dependency ->
|
||||||
|
dependenciesNode.appendNode("dependency").with {
|
||||||
|
it.appendNode("groupId", dependency.group)
|
||||||
|
it.appendNode("artifactId", dependency.name)
|
||||||
|
it.appendNode("version", dependency.version)
|
||||||
|
it.appendNode("scope", "runtime")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
artifacts = [shadowJar]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
def releasesRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-releases/")
|
||||||
|
def snapshotsRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-snapshots/")
|
||||||
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
|
credentials {
|
||||||
|
username = System.getenv("plexUser")
|
||||||
|
password = System.getenv("plexPassword")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -58,9 +58,9 @@ dependencies {
|
|||||||
implementation project(":api")
|
implementation project(":api")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "dev.plex"
|
group = rootProject.group
|
||||||
version = "1.1-SNAPSHOT"
|
version = rootProject.version
|
||||||
description = "Plex"
|
description = "Plex-Server"
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
archiveBaseName.set("Plex")
|
archiveBaseName.set("Plex")
|
||||||
@ -120,52 +120,6 @@ task buildProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
|
|
||||||
}
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
|
||||||
maven(MavenPublication) {
|
|
||||||
pom.withXml {
|
|
||||||
def dependenciesNode = asNode().appendNode("dependencies")
|
|
||||||
configurations.getByName("library").getAllDependencies().each { dependency ->
|
|
||||||
dependenciesNode.appendNode("dependency").with {
|
|
||||||
it.appendNode("groupId", dependency.group)
|
|
||||||
it.appendNode("artifactId", dependency.name)
|
|
||||||
it.appendNode("version", dependency.version)
|
|
||||||
it.appendNode("scope", "provided")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
configurations.getByName("implementation").getAllDependencies().each { dependency ->
|
|
||||||
dependenciesNode.appendNode("dependency").with {
|
|
||||||
it.appendNode("groupId", dependency.group)
|
|
||||||
it.appendNode("artifactId", dependency.name)
|
|
||||||
it.appendNode("version", dependency.version)
|
|
||||||
it.appendNode("scope", "runtime")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
artifacts = [shadowJar]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
def releasesRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-releases/")
|
|
||||||
def snapshotsRepoUrl = uri("https://nexus.telesphoreo.me/repository/plex-snapshots/")
|
|
||||||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
|
||||||
credentials {
|
|
||||||
username = System.getenv("plexUser")
|
|
||||||
password = System.getenv("plexPassword")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
build {
|
build {
|
||||||
dependsOn(shadowJar)
|
dependsOn(shadowJar)
|
||||||
|
Loading…
Reference in New Issue
Block a user