Delete construction history in Jenkins

I'm attempting to delete the build history from Jenkins using the instructions in this answer: How do I clear my Jenkins/Hudson build history? However, I'm getting the following error message: groovy.lang.MissingMethodException: No signature of metho

ElasticSearch Java Api: update existing document

I am currently in the process of attempting to update an ElasticSearch document via the Java API. I have a groovy script with the following code: static updateRequestById(String agencyIndex, String type, String id, def policy) { UpdateRequest updateR

Several Groovy classes in a file when running as a script

I have a project with multiple groovy files, and I have several "tiny" classes that I want to put in a single file. Basically, here is what I want: Foo.groovy: class Foo { Foo() { println "Foo" } } Bar.groovy: class Bar { Bar() { print

Groovy gets a list from a single object

I'm newbie to Groovy and I have a very simple question. I know how to add a single element to an existing list in Java, but I guess there is a quicker way to do it in Groovy, but I don't know how ... Supposing that I have a domain object Obj1, that t

Grails: updating Index.gsp from another controller

My Grails app is using version 2.3.6 In this app there's a Controller class: class UserOrderController { def index(Integer max) { params.max = Math.min(max ?: 20, 100) respond UserOrder.list(params), model:[userOrderInstanceCount: WorkOrder.count()]

How to get 10 records of the child in the grails

Can anyone please help me.I have two domains. Class Parent{ static hasMany = [child: Child]; } Class Child{ } In database there are 20 records.I want to get 10 records only without refreshing the page.So i used remote pagination like. gsp code is <ut

Using Groovy Trait in Grails Test Failure

How can I implement Groovy's new traits in my Grails Spock tests? Every time I try, I get a stacktrace that looks like this. Is there some limitation of Groovy trails that I might not be aware of? JDK Version: java version "1.7.0_65" OpenJDK Run

Spock: How can I get the context of the failed test?

def "validate my files list"() { when: new File(folder).eachFileRecurse { validateFile(it) } then: notThrown(ValidationFailedException) where: folder << ['folder1', 'folder2'] } I have coded that simple test with Spock and Groovy. When it

Get property values ​​in the SoapUI groovy

I'm pretty new to testing and SoapUI and I've just faced a problem: I have 2 soap requests from which I transfer data (using PropertyTransfer) to Properties - I can do that and it works fine for me. But now I would like to take those values in my gro

Groovy XmlSlurper analyzes text and mixed nodes

I'm currently trying to parse a node in groovy which contains mixed text and nodes with text and I need to get the text in the right order for example: <?xml version="1.0" encoding="UTF-8"?> <root> <p> The text has &l

Grails parse params for Datatable 1.10 ajax request

I am using Datable 1.10 server side processing with Grails. New version of Datatable changed the ajax post request format. I am parsing params values like this. its giving the error. println params?.start println params?.columns[1]?.search?.regex in

Groovy timestamp conversion that returns incorrect values

I'm trying to convert a timestamp to a date with format DD/MM/YYYY using Groovy To do this, I initially get a Timestamp value returned from a database query. It has the format: YYYY-MM-DD HH:MM:SS.S (the .S is actually a milisecond I guess) So I crea

php as associative arrays in Groovy

I'm coming from the PHP world and I need to do do some tallying of records. In php I know this is simple, but how do I do the following in Groovy $logs = array( array( 'date' => '5-15', 'name' => 'foo' ...other stuff), array( 'date' => '5-15', 'n

optional parameters for immutable classes

I am not sure whether this is the right forum to ask this question, but it refers to code, so I am asking here. In the book "Groovy in action", section 7.1.4 (named parameters), the author says that usage of named params "crops up frequentl

Grails on Google-App-Engine - Is it dead?

To create a web application on Google's AppEngine I was looking for a framework. During my research I came across Groovy and Grails. I'm a Java kind of guy so I prefer something Java-like above Python frameworks (like Django). So I scraped together s

Grails Hql request for an association with several

I have a Training domain class class Training { String type Date createdOn Date modifiedOn static belongsTo = [course: Course] static hasMany = [attachments: Attachment] } and i have Course domain class class Course { String name static hasMany = [tr

the iterator prints up to 48 when the argument provided is 1

static void main(args){ { def input = it.readLine() for(def i = 0; i < input; i++){ println i } } } The source code..simple one I guess but dont know why it is printing till is the output if the argument supplied is 1. 0

How to sort a list by existing properties

I am using this line here to sort a list based on the object's name. g.V.sort{} How do I sort it based on "name" if it exists, if not, I wanna sort it by "title". If both exist I want to first sort by "name" and then b

Compile groovy scripts from a database

Groovy scripts are placed in a Database entry (data type BLOB). I can read the bytes and convert to a String object. How can I use GroovyClassLoader or GroovyScriptEngine to compile and execute the script? I need to track dependencies between scripts

A more elegant way to launch in the groovy base

I always seem to be needing to cast values in the params object in order to perform a .equals but it never feels right. If i use the parseXXX methods I also have to protect myself when the value is empty. It seems like there would be a better way to

Is there a way to do it in Groovy?

I want a code that will return a list like this : def list = ["RR","SS"] //code to get the output as [R,R,S,S] I came up with idea like this: def Ash = ["RR","as","RTY"] def listA = [] for(i=0;i<Ash.siz

How to capture arguments passed to a Groovy script?

I am just starting out with Groovy. I couldn't find any examples anywhere of how to handle arguments to a Groovy script and so I hacked this method myself. There must be a better way of doing this? If so, I am looking for this better way, since I am