From bf08170dc84af2adfe6bf5d5695bee2f8a5f0f52 Mon Sep 17 00:00:00 2001 From: Ronald Holshausen Date: Thu, 2 Mar 2023 14:41:44 +1100 Subject: [PATCH] fix: task to generate Maven plugin descriptor was accidentally commented out #1672 --- provider/maven/build.gradle | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/provider/maven/build.gradle b/provider/maven/build.gradle index cfaa9c3a1..133f4ebe4 100644 --- a/provider/maven/build.gradle +++ b/provider/maven/build.gradle @@ -48,29 +48,29 @@ task generatePom(type: GenerateMavenPom, dependsOn: [":provider:publishToMavenLo } } -//if (System.env.CI != 'true') { -// task pluginDescriptor(type: Exec, dependsOn: generatePom) { -// if (isWindows()) { -// try { -// // check if mvn.bat exists -// def proc = new ProcessBuilder('mvn.bat', '-v') -// proc.start().waitFor() -// -// commandLine 'mvn.bat', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor' -// } catch(Exception e) { -// commandLine 'mvn.cmd', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor' -// } -// } else { -// commandLine 'sh', '-c', "mvn -f ${buildDir}/poms/pom.xml -e -B org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor" -// } -// -// doLast { -// final dir = project.compileKotlin.destinationDirectory.dir('META-INF/maven').get() -// final pluginDescriptor = dir.file('plugin.xml').getAsFile() -// assert pluginDescriptor.exists(), "[$pluginDescriptor.canonicalPath] was not created" -// } -// } -// -// pluginDescriptor.shouldRunAfter project.jar -// project.jar.dependsOn pluginDescriptor -//} +if (System.env.CI != 'true') { + task pluginDescriptor(type: Exec, dependsOn: generatePom) { + if (isWindows()) { + try { + // check if mvn.bat exists + def proc = new ProcessBuilder('mvn.bat', '-v') + proc.start().waitFor() + + commandLine 'mvn.bat', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor' + } catch(Exception e) { + commandLine 'mvn.cmd', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor' + } + } else { + commandLine 'sh', '-c', "mvn -f ${buildDir}/poms/pom.xml -e -B org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor" + } + + doLast { + final dir = project.compileKotlin.destinationDirectory.dir('META-INF/maven').get() + final pluginDescriptor = dir.file('plugin.xml').getAsFile() + assert pluginDescriptor.exists(), "[$pluginDescriptor.canonicalPath] was not created" + } + } + + pluginDescriptor.shouldRunAfter project.jar + project.jar.dependsOn pluginDescriptor +}