aperepel / nifi-api-deploy

Demonstrates NiFi template deployment and configuration via a REST API
Apache License 2.0
68 stars 37 forks source link

"org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed" TemplateInspector.groovy line 61 #8

Closed jvanbemmelen closed 8 years ago

jvanbemmelen commented 8 years ago
# groovy TemplateInspector.groovy 'https://cwiki.apache.org/confluence/download/attachments/57904847/Hello_NiFi_Web_Service.xml?version=1&modificationDate=1449369797000&api=v2'
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/root/nifi-api-deploy/TemplateInspector.groovy: 61: unexpected token: ? @ line 61, column 27.
                             ? node.processors          // root process group
                             ^

1 error

Caused by the newline after node.contents.isEmpty() on line 61. Fix:

diff --git a/TemplateInspector.groovy b/TemplateInspector.groovy
index 466530f..83b19e7 100644
--- a/TemplateInspector.groovy
+++ b/TemplateInspector.groovy
@@ -57,8 +57,8 @@ def parseGroup(node) {
 }

 def parseProcessors(groupName, node) {
-  def processors = node.contents.isEmpty()
-                          ? node.processors          // root process group
+  def processors = node.contents.isEmpty() ?
+                            node.processors          // root process group
                           : node.contents.processors // regular process group
   processors.each { p ->
     y.processGroups[groupName].processors[p.name.text()] = [:]
aperepel commented 8 years ago

Hi @jvanbemmelen , curious, which groovy version are you running?

aperepel commented 8 years ago

I couldn't reproduce with Groovy Version: 2.4.6 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Mac OS X, but updated the code as suggested, no regressions on my side. Thanks for your contribution!