Skip to content

Commit bf08170

Browse files
committed
fix: task to generate Maven plugin descriptor was accidentally commented out #1672
1 parent 7356aaf commit bf08170

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

provider/maven/build.gradle

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,29 @@ task generatePom(type: GenerateMavenPom, dependsOn: [":provider:publishToMavenLo
4848
}
4949
}
5050

51-
//if (System.env.CI != 'true') {
52-
// task pluginDescriptor(type: Exec, dependsOn: generatePom) {
53-
// if (isWindows()) {
54-
// try {
55-
// // check if mvn.bat exists
56-
// def proc = new ProcessBuilder('mvn.bat', '-v')
57-
// proc.start().waitFor()
58-
//
59-
// commandLine 'mvn.bat', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor'
60-
// } catch(Exception e) {
61-
// commandLine 'mvn.cmd', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor'
62-
// }
63-
// } else {
64-
// commandLine 'sh', '-c', "mvn -f ${buildDir}/poms/pom.xml -e -B org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor"
65-
// }
66-
//
67-
// doLast {
68-
// final dir = project.compileKotlin.destinationDirectory.dir('META-INF/maven').get()
69-
// final pluginDescriptor = dir.file('plugin.xml').getAsFile()
70-
// assert pluginDescriptor.exists(), "[$pluginDescriptor.canonicalPath] was not created"
71-
// }
72-
// }
73-
//
74-
// pluginDescriptor.shouldRunAfter project.jar
75-
// project.jar.dependsOn pluginDescriptor
76-
//}
51+
if (System.env.CI != 'true') {
52+
task pluginDescriptor(type: Exec, dependsOn: generatePom) {
53+
if (isWindows()) {
54+
try {
55+
// check if mvn.bat exists
56+
def proc = new ProcessBuilder('mvn.bat', '-v')
57+
proc.start().waitFor()
58+
59+
commandLine 'mvn.bat', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor'
60+
} catch(Exception e) {
61+
commandLine 'mvn.cmd', '-f', "${buildDir}/poms/pom.xml", '-e', '-B', 'org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor'
62+
}
63+
} else {
64+
commandLine 'sh', '-c', "mvn -f ${buildDir}/poms/pom.xml -e -B org.apache.maven.plugins:maven-plugin-plugin:3.6.1:descriptor"
65+
}
66+
67+
doLast {
68+
final dir = project.compileKotlin.destinationDirectory.dir('META-INF/maven').get()
69+
final pluginDescriptor = dir.file('plugin.xml').getAsFile()
70+
assert pluginDescriptor.exists(), "[$pluginDescriptor.canonicalPath] was not created"
71+
}
72+
}
73+
74+
pluginDescriptor.shouldRunAfter project.jar
75+
project.jar.dependsOn pluginDescriptor
76+
}

0 commit comments

Comments
 (0)