Groovy
Maven Plugins 0.2.5 – Artifactory Online, Maven Central!
Today I’m very excited to announce the availability of Maven Plugins v0.2.5! This version is not a regular update: it contains a great deal of infrastructural changes which I’ve been considering and working on for the past six months. Here it goes: My Artifactory repository has moved from evgeny-goldin.org/artifactory to Artifactory Online at evgenyg.artifactoryonline.com. What [...]
Maven build progress with TeamCity Service Messages
When you run a lengthy Maven build configuration in TeamCity it may be tricky to know what module is being built right now since all TeamCity displays is either “Running” or “Tests passed: X”. Luckily, TeamCity allows your build script to interact with the server using Service Messages. When you build script prints out the [...]
10 Cool Facts about Gradle
About a month ago @saylambda user group (lambda.org.il) had a “JavaScript as a Functional Language” meeting, very nicely presented by Zachary Kessin (@zkessin). You can see a summary, HTML slides and video recording of the session. This time the subject was Groovy and Ronen Narkis (@narkisr) presented Groovy as a language, its powerful GDK, AST [...]
Groovy 1.8.0 – meet JsonBuilder!
Groovy 1.8.0 released in April brought a lot of new features to the language, one of them is native JSON support through JsonSlurper for reading JSON and JsonBuilder for writing JSON. I recently used JsonBuilder in one of my projects and initially experienced some difficulties in understanding how it operates. My assumption was that JsonBuilder [...]
Groovy: Picking a value from a number of options
Let’s say you need to define a value based on a number of conditions. If first condition holds true, then the value is X, if second condition holds true then the value is Y and so on. I used to go with a multi-level ternary operator to accomplish that: Today @tim_yates has suggested a more [...]
Maven Plugins v0.2.1 – re-written and open-sourced!
A “0.1″ release of these Maven plugins back in November brought a lot of attention to the project, which showed me that other Maven developers find them as useful as I do. Later, people started to send me new suggestions and open YouTrack issues which I had an extreme pleasure to work on. Version “0.2.1″ [...]
Consider returning something instead of void
Some methods are not supposed to return anything so they usually return void: This short method verifies objects specified are not nulls. It is part of verifiers library I usually carry around with me: But .. when you have something in your hand, why throwing it away? Initially, all verifiers returned void but after changing [...]
Keeping Groovy Beans in the same file
It is so handy to keep a bunch of Groovy Beans in the same file! “Beans.groovy”:
Splitting Groovy objects with “each”-like iterations
String.eachLine(Closure closure) allows to iterate a String line by line: Similarly, File.eachFile(groovy.lang.Closure) iterates over all directory files: In fact, Object.each(groovy.lang.Closure) is the most general way to iterate over “parts” of an object: Here I use a fact that File.withReader(groovy.lang.Closure) passes java.io.LineNumberReader into a closure and its “each” iterates over lines. That’s how we get each [...]


