mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 15:37:10 -07:00
Add support for publishing the fat jar
This commit adds compatibility with the Maven publish plugin, by making sure that if the application is published, then the uber jar is published as a classified artifact (`-uber`) in addition to the regular jar. A sample publishing configuration was added to the `app`, with a "local" publishing repository in <rootproject>/build/repo. For example, calling `./gradlew pAPTBR` will create the `build/repo` directory with the corresponding Maven repository structure after publishing.
This commit is contained in:
parent
c8b3cc7890
commit
f6deafda3a
2 changed files with 61 additions and 8 deletions
|
@ -4,17 +4,25 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|||
plugins {
|
||||
application
|
||||
id("com.uwyn.rife2")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
base {
|
||||
archivesName.set("hello")
|
||||
version = 1.0
|
||||
group = "com.example"
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("hello.App")
|
||||
}
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
// Use Maven Central for resolving dependencies.
|
||||
mavenCentral()
|
||||
|
@ -44,3 +52,17 @@ tasks {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
repositories {
|
||||
maven {
|
||||
name = "Build"
|
||||
url = uri(rootProject.layout.buildDirectory.dir("repo"))
|
||||
}
|
||||
}
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue