diff options
author | aSemy <897017+aSemy@users.noreply.github.com> | 2023-03-17 15:27:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-17 15:27:03 +0100 |
commit | 8bb4f4a86b131e9740a8074cb5775930f8280019 (patch) | |
tree | 2fea9f93d621d1a2c72129358a45a565cca68e6c /runners/maven-plugin/build.gradle.kts | |
parent | 2a3917b7eb70b39360893b61f5cd7f580c41cfda (diff) | |
download | dokka-8bb4f4a86b131e9740a8074cb5775930f8280019.tar.gz dokka-8bb4f4a86b131e9740a8074cb5775930f8280019.tar.bz2 dokka-8bb4f4a86b131e9740a8074cb5775930f8280019.zip |
Introduce Gradle Version Catalog with type-safe project dependencies (#2884)
Diffstat (limited to 'runners/maven-plugin/build.gradle.kts')
-rw-r--r-- | runners/maven-plugin/build.gradle.kts | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/runners/maven-plugin/build.gradle.kts b/runners/maven-plugin/build.gradle.kts index 90f2ffef..d91b8889 100644 --- a/runners/maven-plugin/build.gradle.kts +++ b/runners/maven-plugin/build.gradle.kts @@ -8,12 +8,12 @@ plugins { } dependencies { - implementation(project(":core")) - implementation("org.apache.maven:maven-core:${setupMavenProperties.mavenVersion.get()}") - implementation("org.apache.maven:maven-plugin-api:${setupMavenProperties.mavenVersion.get()}") - implementation("org.apache.maven.plugin-tools:maven-plugin-annotations:${setupMavenProperties.mavenPluginToolsVersion.get()}") - implementation("org.apache.maven:maven-archiver:2.5") - implementation(kotlin("stdlib-jdk8")) + implementation(projects.core) + + implementation(libs.apache.mavenCore) + implementation(libs.apache.mavenPluginApi) + implementation(libs.apache.mavenPluginAnnotations) + implementation(libs.apache.mavenArchiver) } val mavenPluginTaskGroup = "maven plugin" @@ -27,8 +27,8 @@ val generatePom by tasks.registering(Sync::class) { val pomTemplateFile = layout.projectDirectory.file("pom.template.xml") - val mavenVersion = setupMavenProperties.mavenVersion.get() - val mavenPluginToolsVersion = setupMavenProperties.mavenPluginToolsVersion.get() + val mavenVersion = mavenCliSetup.mavenVersion.orNull + val mavenPluginToolsVersion = mavenCliSetup.mavenPluginToolsVersion.orNull from(pomTemplateFile) { rename { it.replace(".template.xml", ".xml") } @@ -52,7 +52,7 @@ val prepareMavenPluginBuildDir by tasks.registering(Sync::class) { from(generatePom) - into(setupMavenProperties.mavenBuildDir) + into(mavenCliSetup.mavenBuildDir) } val helpMojo by tasks.registering(Exec::class) { @@ -60,11 +60,11 @@ val helpMojo by tasks.registering(Exec::class) { dependsOn(tasks.installMavenBinary, prepareMavenPluginBuildDir) - workingDir(setupMavenProperties.mavenBuildDir) - executable(setupMavenProperties.mvn.get()) + workingDir(mavenCliSetup.mavenBuildDir) + executable(mavenCliSetup.mvn.get()) args("-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:helpmojo") - outputs.dir(setupMavenProperties.mavenBuildDir) + outputs.dir(mavenCliSetup.mavenBuildDir) doLast("normalize maven-plugin-help.properties") { // The maven-plugin-help.properties file contains a timestamp by default. @@ -89,9 +89,13 @@ val pluginDescriptor by tasks.registering(Exec::class) { dependsOn(tasks.installMavenBinary, prepareMavenPluginBuildDir) - workingDir(setupMavenProperties.mavenBuildDir) - executable(setupMavenProperties.mvn.get()) - args("-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:descriptor") + workingDir(mavenCliSetup.mavenBuildDir) + executable(mavenCliSetup.mvn.get()) + args( + "-e", + "-B", + "org.apache.maven.plugins:maven-plugin-plugin:descriptor" + ) outputs.dir(layout.buildDirectory.dir("maven/classes/java/main/META-INF/maven")) } @@ -99,7 +103,7 @@ val pluginDescriptor by tasks.registering(Exec::class) { tasks.jar { dependsOn(pluginDescriptor, helpMojo) metaInf { - from(setupMavenProperties.mavenBuildDir.map { it.dir("classes/java/main/META-INF") }) + from(mavenCliSetup.mavenBuildDir.map { it.dir("classes/java/main/META-INF") }) } manifest { attributes("Class-Path" to configurations.runtimeClasspath.map { configuration -> |