diff --git a/azure-functions-archetype/src/main/resources/META-INF/archetype-post-generate.groovy b/azure-functions-archetype/src/main/resources/META-INF/archetype-post-generate.groovy index 663f67e..0557223 100644 --- a/azure-functions-archetype/src/main/resources/META-INF/archetype-post-generate.groovy +++ b/azure-functions-archetype/src/main/resources/META-INF/archetype-post-generate.groovy @@ -34,7 +34,7 @@ def triggerParameter = templateMap.keySet().stream() .filter({ key -> key.equalsIgnoreCase(trigger) || key.substring(0, key.lastIndexOf("Trigger")).equalsIgnoreCase(trigger) }).findFirst() .map(templateMap.&get) .orElseThrow({ -> new RuntimeException(String.format("Invalid trigger type `%s`, supported values are %s and HttpTrigger", trigger, String.join(",", templateMap.keySet()))) }) -println("Generating trigger from template, please replace the values with placeholder in annotation with real value if necessary") +println("Generating trigger from template, which may take some moments. Please replace the values with placeholder in annotation with real value if necessary") def pomFile = new File(rootDir, "pom.xml") def isWindows = System.properties['os.name'].toLowerCase().contains('windows') def starter = isWindows ? "cmd.exe" : "/bin/sh" @@ -46,7 +46,7 @@ if (!isWindows) { def output = new StringBuilder() def proc = [starter, switcher, command].execute(); proc.consumeProcessOutput(output, output) -proc.waitForOrKill(60 * 1000); // wait for 60s +proc.waitFor() if (proc.exitValue() != 0 || output == null || !output.contains("BUILD SUCCESS")) { println("${output}") throw new RuntimeException("Failed to generate target trigger, please run `mvn azure-functions:add` manually in project root")