Re: Re: making the most of Groovy in Action 2nd edition

2024-04-02 Thread Nelson, Erick
Not sure if this is the best way to do this, but I wrap antbuilder in my own class so that I can get ant event messages to my logger package script.ant import groovy.ant.AntBuilder as AB import org.apache.tools.ant.BuildEvent import org.apache.tools.ant.BuildLogger

Re: Re: Extra linefeeds with groovy.xml.XmlUtil.serialize

2023-03-31 Thread Nelson, Erick
elp in your case but they have helped for other tricky XML scenarios. Cheers, Paul. On Sat, Apr 1, 2023 at 1:24 AM Nelson, Erick mailto:erick.nel...@hdsupply.com>> wrote: From: Nelson, Erick mailto:erick.nel...@hdsupply.com>> Date: Friday, March 31, 2023 at 7:53 AM To: users@g

Re: Extra linefeeds with groovy.xml.XmlUtil.serialize

2023-03-31 Thread Nelson, Erick
From: Nelson, Erick Date: Friday, March 31, 2023 at 7:53 AM To: users@groovy.apache.org Subject: Re: Extra linefeeds with groovy.xml.XmlUtil.serialize This appears to be a Java problem, not a Groovy problem, and possibly an OpenJDK issue. I’ve only been able to test this further on my Mac

Re: Extra linefeeds with groovy.xml.XmlUtil.serialize

2023-03-31 Thread Nelson, Erick
this behavior From: Nelson, Erick Date: Tuesday, March 21, 2023 at 10:25 AM To: users@groovy.apache.org Subject: Extra linefeeds with groovy.xml.XmlUtil.serialize I get extra line feeds on my mac when running identical code. Does anybody know why this would be? On Linux… (expected output) [tauser02

Extra linefeeds with groovy.xml.XmlUtil.serialize

2023-03-21 Thread Nelson, Erick
I get extra line feeds on my mac when running identical code. Does anybody know why this would be? On Linux… (expected output) [tauser02@cfmips01ld0s work]$ groovy -v Groovy Version: 4.0.10 JVM: 1.8.0_362 Vendor: Red Hat, Inc. OS: Linux [tauser02@cfmips01ld0s work]$ cat test.groovy String xml =

Re: Re: Using GitHub Packages with Groovy Grapes for scripting

2022-12-07 Thread Nelson, Erick
It’s been awhile since I have done it … and we are in the process of migrating from nexus to jfrog… but think it should just be another ibiblio entry in your grapeConfig.xml. Something like ….. From: Michael Stockman Date: Wednesday, December 7, 2022 at 6:06 AM To: users@groovy.apache.org ,

Re: Checking directory state using Groovy

2021-10-15 Thread Nelson, Erick
import java.nio.file.Path import java.nio.file.Files File f = new File('test') Path p = f.toPath() Files.isReadable(p) // boolean Files.isWritable(p) // boolean Files.isExecutable(p) // boolean Files.isDirectory(p) // boolean Files.isRegularFile(p) // boolean From: James McMahon Date:

Re: groovyc stopped to compile Java after Big Sur update

2021-01-29 Thread Nelson, Erick
Curiously , on my Catalina box, I don’t have JAVA_HOME set either I installed the jdk with this package… % ll Desktop/OpenJDK8U-jdk_x64_mac_hotspot_8u252b09.pkg -rw-r--r--@ 1 en032339 staff 104023171 May 13 2020 Desktop/OpenJDK8U-jdk_x64_mac_hotspot_8u252b09.pkg This is what I see… %

Re: groovyc stopped to compile Java after Big Sur update

2021-01-29 Thread Nelson, Erick
On big sur box, is java_home pointing to jre or jdk? On 1/29/21, 8:47 AM, "o...@ocs.cz" wrote: Hi there, I've got a project which uses both Groovy and Java sources. After Big Sur update -- without touching the project, it remained unchanged and does build perfectly on my other

Re: Grape annotation issue, pom.xml works

2020-11-28 Thread Nelson, Erick
Add an implementation ? @Grapes([ @Grab(group='javax.cache', module='cache-api', version='1.1.1'), @Grab(group='org.mnode.ical4j', module='ical4j', version='3.0.20'), @Grab(group='com.github.ben-manes.caffeine', module='caffeine', version='2.8.6'),

Re: Convert @Grab to Grape.grab ?

2020-01-20 Thread Nelson, Erick
module: 'ojdbc8', version: '19.3.0.0') ... though that could fail with a Security manager exception. On Mon, Jan 20, 2020 at 4:46 PM Nelson, Erick mailto:erick.nel...@hdsupply.com>> wrote: Ya, ive tried that, it’s the grabconfig systemClassLoader=true that is making this difficult for me (I think).

Re: Convert @Grab to Grape.grab ?

2020-01-20 Thread Nelson, Erick
that. From a script you'd do something like: groovy.grape.Grape.grab(classLoader: getClass().classLoader, group: 'com.oracle.ojdbc', module: 'ojdbc8', version: '19.3.0.0') Depending on your context you might need to get the classloader in a slightly different way. Cheers, Paul. On Tue,

Convert @Grab to Grape.grab ?

2020-01-20 Thread Nelson, Erick
Is it possible to convert a Grab annotation to a Grapes.grab call? Example: Convert this… @Grapes([ @GrabConfig(systemClassLoader=true), @Grab('com.oracle:ojdbc6:11.2.0.1.0'), ]) import groovy.sql.Sql to this… groovy.grape.Grape.grab(group:'com.oracle', module:'ojdbc6',

StreamingMarkupBuilder Namespace problem

2019-09-23 Thread Nelson, Erick
has the namespace. Nelson, Erick

Re: Grape resolve broke in 2.5.6 ?

2019-02-28 Thread Nelson, Erick
ilto:remko.po...@gmail.com>> wrote: That’s a bug. Thanks for reporting this. I’ll try to fix this today or tomorrow. Remko. On Feb 28, 2019, at 13:52, Nelson, Erick mailto:erick.nel...@hdsupply.com>> wrote: Am I calling it wrong? $ groovy -v Groovy Version: 2.5.6 JVM: 1.8.0_77 V

Grape resolve broke in 2.5.6 ?

2019-02-27 Thread Nelson, Erick
Am I calling it wrong? $ groovy -v Groovy Version: 2.5.6 JVM: 1.8.0_77 Vendor: Oracle Corporation OS: Mac OS X $ grape list | grep jcraft com.jcraft jsch [0.1.42, 0.1.54, 0.1.55, 0.1.46, 0.1.53] $ grape resolve com.jcraft jsch 0.1.53 java.lang.reflect.InvocationTargetException

Re: What is the best replacement for running scripts using groovy-all?

2018-12-19 Thread Nelson, Erick
Grab caches it files by default in your user home directory in .groovy/grapes Just zip up that dir and copy it to the server you want it on, and extract it. Sent from my iPhone > On Dec 19, 2018, at 1:24 PM, James Kleeh wrote: > > Paul, > > The best solution is to use Maven or Gradle to

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
No, I mean markup builder. Mr Haki says it best…. http://mrhaki.blogspot.com/2009/10/groovy-goodness-creating-xml-with.html Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: mg Reply-To: "users@groovy.apache.org" Date: Tuesday, September 25, 2018 at

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
Looks like a job for MarkupBuilder or StreamingMarkupBuilder Sent from my iPhone On Sep 25, 2018, at 3:56 AM, Jmeter Tea mailto:jmeter...@gmail.com>> wrote: Hello, I have to concatenate a lot of variables in a script and I want to make it readable, but I failed to separate lines as in

Re: Groovy 2.5.* missing in maven central & jcenter

2018-09-01 Thread Nelson, Erick
Groovy , since 2.5.* does not support the all version. You have to get it by module https://search.maven.org/search?q=g:org.codehaus.groovy%20AND%20v:2.5.2 Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: Tommy Svensson Reply-To: Date: Saturday,

Re: multi-declaration does not work in the for loop, groovy 2.4

2018-08-06 Thread Nelson, Erick
Same in 2.5.1 from eclipse photon… org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /Users/en032339/Documents/workspace3/script6/src/erick/erick.groovy: 6: unexpected token: = @ line 6, column 14. for (int foo = 0, bar = 0; foo Reply-To:

New warning messages for 2.5 and Java7

2018-06-04 Thread Nelson, Erick
On a server we still have Java7 installed, I’m getting these warning messages. They look like JUL logging but I’m not sure. I have the jul-to-slf4j bridge installed but these messages don’t seem to be rerouted so I’m not sure what the source is at the moment. I don’t mind the warnings, as long

Re: Running a shell script with return value?

2018-05-30 Thread Nelson, Erick
No such property: LINE for class: file groovy.lang.MissingPropertyException: No such property: LINE for class: file at file.run(file.groovy:5) On Wed, May 30, 2018 at 2:59 PM Nelson, Erick mailto:erick.nel...@hdsupply.com>> wrote: I mistyped It is … $/ /$ Similar to ''' ''' They are known as “dollar s

Re: Running a shell script with return value?

2018-05-30 Thread Nelson, Erick
To: "users@groovy.apache.org" Subject: Re: Running a shell script with return value? Thanks. Do the /$ designate a begin/end fo the commands I want to execute? So using my example, I do String cmd = /$ IFS=" " read -ra LINE <<< `ls -al | grep some_file` echo ${LINE[4]} /$

Re: Running a shell script with return value?

2018-05-30 Thread Nelson, Erick
String cmd = /$ What you want to shell out and execute here Remember, java shells out as sh, not bash or your shell of choice /$ // output and error can be any class that implements Appendable StringBuilder output = new StringBuilder() StringBuilder error = new StringBuilder () Process

Re: does 2.5 break CliBuilder?

2018-05-25 Thread Nelson, Erick
t4 -x opt1 -y,--why opt2 -z,--zedopt3 Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: "Nelson, Erick" <erick.nel...@hdsupply.com> Date: Friday, May 25, 2018 at 5:39 PM To: "users@groovy.apache.org" <users

Re: does 2.5 break CliBuilder?

2018-05-25 Thread Nelson, Erick
: Friday, May 25, 2018 at 5:02 PM To: "users@groovy.apache.org" <users@groovy.apache.org> Subject: Re: does 2.5 break CliBuilder? Do you have a standalone example which triggers the error, i.e. with map and config already set? That will save us time reproducing. Cheers, Paul. On

does 2.5 break CliBuilder?

2018-05-25 Thread Nelson, Erick
Caught: groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: opt for class: org.apache.commons.cli.Option groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: opt for class: org.apache.commons.cli.Option at script.Cli.createOption(Cli.groovy:158)

Re: Help with Groovy syntax

2018-05-25 Thread Nelson, Erick
Looks to me like stage is a method or a closure that takes 2 args. The first is a string, the second is a closure. Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: Chris Fouts Reply-To: "users@groovy.apache.org"

Re: What's the status of the Gpars library ?

2017-10-15 Thread Nelson, Erick
I’m curious, how is gpars better than Java concurrency. I do most of my development with Greclipse, which doesn’t come with G pars so ive never really tried it. Is there some link out there that I can check out that compares both? Sent from my iPhone On Oct 15, 2017, at 5:02 AM, David Dawson

Groovydoc -> PDF ?

2017-05-24 Thread Nelson, Erick
Does such a thing exist? Is there a doclet for this? I’ve tried AurigaDoclet but it seems to only work with java source.

Re: Binary to Base64 Conversion

2017-05-12 Thread Nelson, Erick
ary value from the webservice is APPUID=.A�Tzg�<�^, The vendor tells me its binary on top of base64. If I try decodeBase64() on this, it throws: bad character in base64 value I guess I need to convert it first from binary to base64 format, and then decodeBase64(). I don't find binary to

Re: Trouble with groovy.sql

2017-05-03 Thread Nelson, Erick
The Map version lets me provide named parameters for substitution. -Thom On Wed, May 3, 2017 at 2:08 PM Nelson, Erick <erick.nel...@hdsupply.com<mailto:erick.nel...@hdsupply.com>> wrote: I think this... List<List> keys = mdds.executeInsert(params, mdSqlString); should be this.

Re: Trouble with groovy.sql

2017-05-03 Thread Nelson, Erick
I think this... List keys = mdds.executeInsert(params, mdSqlString); should be this List keys = mdds.executeInsert(mdSqlString, params); from the groovy sql source public List executeInsert (String sql, List params) throws SQLException { Connection

Re: Optimising a Groovy script

2017-03-29 Thread Nelson, Erick
: This message is for intended addressee(s) only and may contain information that is confidential, proprietary or exempt from disclosure, and subject to terms at: http://www.hdsupply.com/email. On 3/29/17, 1:19 AM, "Paul Moore" <p.f.mo...@gmail.com> wrote: >On 28 March 2017 at 2

Re: Looping through a hashmap & removing elements

2016-06-02 Thread Nelson, Erick
Does something like this work? uidMap.keySet().removeAll(uidMap.findAll{it.key == '?'}.keySet()) From: Guy Matz > Reply-To: "users@groovy.apache.org" > Date:

RE: Debug logging in AntBuilder

2016-03-28 Thread Nelson, Erick
Along with CliBuilder def ant = new AntBuilder() ant.project.buildListeners.each { it.messageOutputLevel = ant.project.MSG_DEBUG } Erick Nelson Senior Developer | IT Application Development HD Supply Facilities Maintenance O: 858-831-2209 C: 760-473-7542 H: 760-930-0461