aboutsummaryrefslogtreecommitdiff
path: root/runners/maven-plugin/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'runners/maven-plugin/build.gradle')
-rw-r--r--runners/maven-plugin/build.gradle22
1 files changed, 20 insertions, 2 deletions
diff --git a/runners/maven-plugin/build.gradle b/runners/maven-plugin/build.gradle
index 79a8c22b..7e94058e 100644
--- a/runners/maven-plugin/build.gradle
+++ b/runners/maven-plugin/build.gradle
@@ -19,7 +19,13 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
}
}
+configurations {
+ maven
+}
+
dependencies {
+ maven group: "org.apache.maven", name: 'apache-maven', version: maven_version, classifier: 'bin', ext: 'zip'
+
shadow project(":runners:fatjar")
shadow "org.apache.maven:maven-core:$maven_version"
shadow "org.apache.maven:maven-model:$maven_version"
@@ -31,6 +37,18 @@ dependencies {
shadow "com.github.olivergondza:maven-jdk-tools-wrapper:0.1"
}
+final File mavenHome = new File(buildDir, "maven-bin")
+final File mvn = new File(mavenHome, "apache-maven-$maven_version/bin/mvn")
+
+tasks.clean.doLast {
+ delete mavenHome
+}
+
+task setupMaven(type: Sync) {
+ from configurations.maven.collect{ zipTree(it) }
+ into "$buildDir/maven-bin"
+}
+
task generatePom() {
inputs.file(new File(projectDir, "pom.tpl.xml"))
outputs.file(new File(buildDir, "pom.xml"))
@@ -58,14 +76,14 @@ task mergeClassOutputs doLast {
}
}
-task pluginDescriptor(type: CrossPlatformExec) {
+task pluginDescriptor(type: CrossPlatformExec, dependsOn: setupMaven) {
workingDir buildDir
commandLine mvn, '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:descriptor'
dependsOn mergeClassOutputs
}
-task helpMojo(type: CrossPlatformExec) {
+task helpMojo(type: CrossPlatformExec, dependsOn: setupMaven) {
workingDir buildDir
commandLine mvn, '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:helpmojo'