Re: Re: using @GrabConfig(systemClassLoader=true) in a ScriptEngine

2025-07-11 Thread Nelson, Erick
Not sure if this helps…. I’ve programmatically loaded ivy assets using groovy.grape.Grape.grab I’ve not had luck with developers remembering the grap grab with systems classloader annotations, and I got tired of answering how to or pointing to docs, so I do it for them in my database connect

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 @groovy.util.logging.S

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

2023-03-31 Thread Nelson, Erick
#x27;t think they will help 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, 20

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
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 , Di

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: Fr

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… % /us

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 machin

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'), @Grab('org.jsr107.ri:cache-ri-i

Re: Convert @Grab to Grape.grab ?

2020-01-20 Thread Nelson, Erick
ab(classLoader: ClassLoader.getSystemClassLoader(), group: 'com.oracle.ojdbc', 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

Re: Convert @Grab to Grape.grab ?

2020-01-20 Thread Nelson, Erick
need 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 d

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', version:'11.2.0.1.0

StreamingMarkupBuilder Namespace problem

2019-09-23 Thread Nelson, Erick
1 2019-09-21 daily 1 b a c d e f g Why am I getting all the extra xmlns attributes? Seems like every 3 nodes 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 a

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 crea

Re: Long String concatenation failed

2018-09-25 Thread Nelson, Erick
ect: Re: Long String concatenation failed Thank for your answers, I still have some comments: mg: I don't want to have a huge line with 20 parameters that can't be seen on screen so I need new lines between parameters Nelson, Erick: I don't need XML as the article suggest " build

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 5:19

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 java,

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, Septe

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: "users@groovy.apache.o

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
ion: 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 ''' ''

Re: Running a shell script with return value?

2018-05-30 Thread Nelson, Erick
day, May 30, 2018 at 11:55 AM 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 so

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 pro

Re: does 2.5 break CliBuilder?

2018-05-25 Thread Nelson, Erick
:: opt3 :: class java.lang.String ], quiet=[ option: null quiet :: opt4 :: class java.lang.String ]} ] usage: groovy --quiet opt4 -x opt1 -y,--why opt2 -z,--zedopt3 Erick Nelson Senior Developer – IT HD Supply Facilities Maintenance (858) 740-6523 From: "

Re: does 2.5 break CliBuilder?

2018-05-25 Thread Nelson, Erick
ers@groovy.apache.org" , "pa...@asert.com.au" Date: Friday, May 25, 2018 at 5:02 PM To: "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

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) a

Re: Help with Groovy syntax

2018-05-25 Thread Nelson, Erick
kout" as one of the stages. Chris On Fri, May 25, 2018 at 9:47 AM Nelson, Erick mailto:erick.nel...@hdsupply.com>> wrote: 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 Suppl

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" Date: Friday, May 25, 2018 at 6:35 AM To:

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
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 base64 decoding in the link. On Fri, May 12, 2017 at 10:07 PM, Nelson, Erick

Re: Binary to Base64 Conversion

2017-05-12 Thread Nelson, Erick
Apache Commons codec https://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/binary/Base64.html Erick Nelson Senior Developer HD Supply, FM Cell 858-740-6523 Home 760-930-0461 CONFIDENTIALITY NOTICE: This message is for intended addressee(s) only and may contain informa

Re: Trouble with groovy.sql

2017-05-03 Thread Nelson, Erick
: Re: Trouble with groovy.sql Erick, Thanks for your quick response! I'm not using the executeInsert(String sql, List params) version. I'm using the executeInsert(Map params, String sql) version. The Map version lets me provide named parameters for substitution. -Thom On Wed, May 3,

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 connection = crea

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" wrote: >On 28 March 2017 at 22:08, Nelson, Erick &

Re: Optimising a Groovy script

2017-03-28 Thread Nelson, Erick
Try this... @Grapes( @Grab(group='org.apache.commons', module='commons-math3', version='3.6.1') ) import org.apache.commons.math3.random.MersenneTwister import groovy.time.* def benchmark = { closure -> def start = new Date() closure.call() TimeCategory.minus(ne

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 mailto:guym...@gmail.com>> Reply-To: "users@groovy.apache.org" mailto:users@groovy.apache.org>> Date: Thursday, June 2, 2016 at 11:18 AM To: "users@g

RE: Debug logging in AntBuilder

2016-03-28 Thread Nelson, Erick
rch 28, 2016 10:37 AM To: users@groovy.apache.org Subject: Re: Debug logging in AntBuilder Unfortunately that does not work for me. Having checked the Ant docs, there is not messageOutputLevel on BuildLIstener. On 28/03/2016 17:51, Nelson, Erick wrote: > Along with CliBuilder

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 erick.nel...@hdsuppl

RE: Groovy Hash Calculations

2016-03-04 Thread Nelson, Erick [HDS]
I had to do this in one of my apps. I used java’s nameUUIDFromBytes from java.util UUID.nameUUIDFromBytes(map.v as byte[]).toString() If I read the docs right, it uses sha-1 under the hood. Erick Nelson Senior Developer | IT Application Development HD Supply Facilities Maintenance O: 858-831-2

RE: @Log annotation inside Groovy Script

2016-01-08 Thread Nelson, Erick [HDS]
I’m not sure if there is a better way to handle script logging. The annotations is for classes and you cannot apply it to your script class. Another disadvantage is that I don’t think you can use the logger in static methods. What you can do is ‘override’ the groovy Script class (the class that