Home » Tag Archives: Groovy

Tag Archives: Groovy

Building Java 6-8 Libraries for JPMS in Gradle

Find out how to use Gradle to build Java 6-8 libraries that support JPMS (Java Platform Module System) by providing Java 9 module-info.class. Introduction If you need introduction to JPMS itself, check out this nice overview. This post is primarily targeted at Java library maintainers. Any such maintainer has to make a choice of which JDK to target: Targeting the ...

Read More »

Testing Kotlin with Spock Part 3 – Interface default method

Kotlin allows you to put method implementation in an interface. The same mechanism can be found in Java interfaces as default methods (and also Groovy or Scala traits). Let’s see the difference between the Kotlin and Java default methods in interface by testing it with Groovy and Spock. What do we want to test? We often have an interface for ...

Read More »

Gradle Dependencies for Java, use compile or implementation?

While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of the examples were using the compile configuration for dependencies, while others were using implements and api. dependencies { compile 'commons-httpclient:commons-httpclient:3.1' compile 'org.apache.commons:commons-lang3:3.5' } dependencies { api 'commons-httpclient:commons-httpclient:3.1' implementation 'org.apache.commons:commons-lang3:3.5' } This post was ...

Read More »

X-Mas Musings – Too Many Paths. One Path Spec?

December is for many people a period of reflection or thought. So I decided to reflect upon last year’s things and thoughts — each day until Christmas. This is day 15. Within a typical (Java) project there a lots of places where some kind of “path” needs to be specified. Gradle For starters, in any build configuration quite a few ...

Read More »

Escaping XML with Groovy 2.1

When posting source code to my blog, I often need to convert less than signs (<), and greater than signs (>) to their respective entity references so that they are not confused as HTML tags when the browser renders the output. I have often done this using quick search-and-replace syntax like %s/</\&lt;/g and %s/>/\&gt;/g with vim or Perl. However, Groovy ...

Read More »

Hello GroovyFX

GroovyFX brings together two of my favorite things: Groovy and JavaFX. The main GroovyFX Project page describes GroovyFX as ‘[providing] a Groovy binding for JavaFX 2.0.’ GroovyFX is further described on that page: GroovyFX is an API that makes working with JavaFX in Groovy much simpler and more natural. GroovyFX is focused on exploiting the power of the Groovy Builder ...

Read More »