Skip to content

Commit

Permalink
fix: task to generate Maven plugin descriptor was accidentally commen…
Browse files Browse the repository at this point in the history
…ted out #1672
  • Loading branch information
rholshausen committed Mar 2, 2023
1 parent 7356aaf commit bf08170
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions provider/maven/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit bf08170

Please sign in to comment.