Re: XmlSlurper Namespace Question

2016-04-15 Thread John Wagenleitner
By default XmlSlurper is namespace aware so new XmlSlurper() is the same as new XmlSlurper(false, true). I tried your example and I still get the original prefixes. Maybe the difference is in how your code is removing the node? import groovy.xml.* String xml = ''' child1

RE: XmlSlurper Namespace Question

2016-04-15 Thread Kenton Garner
I appreciate your response. The problem is that the node that is being removed will be defined by the user during a configuration stage. Because of the generic nature the node to remove will be defined via a GPath string. I do not want to require the user to specify the GPath string with the n

RE: ConfigSlurper not finding Config.groovy in jar

2016-04-15 Thread Billy Buzzard
AFAIK under normal circumstances the compiler should only be compiling files that are under the src/main/java folder, but when compiling groovy files it appears all src folders are included like the src/main/resources folder. I bet you can add a configuration element to the groovy compiler in t

RE: ConfigSlurper not finding Config.groovy in jar

2016-04-15 Thread Billy Buzzard
The reason “Config.class” is appearing in your jar is because you specified “Config.groovy” in the src/main/resources. The compiler sees the “.groovy” suffix and compiles the file into a “.class” flie. Simply changing the filename to something like “Config.properties” should stop the name from

Re: XmlSlurper Namespace Question

2016-04-15 Thread John Wagenleitner
Are you doing more than just removing nodes? The following seems to retain the namespace prefixes when serializing back out after removing a node. import groovy.xml.* String xml = ''' child1 child2 child3 ''' def root = new XmlSlurper().parseText(xml) root.child2.replaceNode {}

Re: ConfigSlurper not finding Config.groovy in jar

2016-04-15 Thread Guy Matz
As usual, the Groovy solution is far simpler than anticipated. Thank you!! On Fri, Apr 15, 2016 at 1:25 PM, John Wagenleitner < john.wagenleit...@gmail.com> wrote: > If the build is compiling the file you probably either need to copy it > into your jar from another location or you might be able

Re: No signature of method

2016-04-15 Thread John Wagenleitner
In your Java version you call awaitCompletion on the new ExecStartResultCallback: .exec( new ExecStartResultCallback(System.out, System.err) .awaitCompletion() ); In your Groovy version you don't, maybe just a mis-placed ending paren? .exec(new ExecStartResultCallback(System.out, System.

Re: ConfigSlurper not finding Config.groovy in jar

2016-04-15 Thread John Wagenleitner
If the build is compiling the file you probably either need to copy it into your jar from another location or you might be able to use the #parse(Class) method of ConfigSlurper. def config = new ConfigSlurper().parse(Config) On Fri, Apr 15, 2016 at 9:07 AM, Guy Matz wrote: > Hi! I can't seem t

ConfigSlurper not finding Config.groovy in jar

2016-04-15 Thread Guy Matz
Hi! I can't seem to find and slurp in a config file that's contained in a jar. I think part of the problem may be that the config.groovy file is being compiled into a class, but can't figure out the right way to go about slurping it in . . . from an ancient post I have the following code: def

No signature of method

2016-04-15 Thread marbon
Hi, i have the following Java-Code that i want to convert to groovy: My current version in groovy is this: My problem is, that i get the following error, when i try to run the groovy code: The Java-exec-Method has the signature: I tried to cast "new ExecStartResultCallback(System.out, Sy