Open Source Consultant, Software Developer and System Administrator

If you are interrested in hiring a consultant for the effective use of open source software on an enterprise grade, take a look around in the About section to see, what I have to offer.

Blog and snippets

Various snippets or code parts I found useful, so I keep them here for reference.

Pattern for the Vat ID

According to Wikipedia:


Excluding deps in configurations, added by plugin, in gradle

The gradle-vaadin-plugin adds its configurations, that later get used to gather the deps for the client compile run, when it runs. So one can not safely create configs and exclude deps there beforehand. But gradle let's you do even this at a later time. This fragment gets rid of springboot-starter-web, as this pulls in java-validation 1.1, which won't compile the client due to GWT restrictions.

project.afterEvaluate {
        configurations.'vaadin-client' {
                exclude module: 'spring-boot-starter-web'

See my springboot-groovy-vaadin-starter

Helper to search maven central from command line

If the query contains a : search for all version otherwise do a regular search for latest versions

assert args.size()==1, "Missing parameter"
def q=args[0]
if (q.contains(':')) {
    def (g,a) = q.split(':')
    q = "g:\"$g\"+AND+a:\"$a\"&core=gav"
def result = new groovy.json.JsonSlurper().parseText(
) {
    println "compile '$it.g:$it.a:${it.latestVersion?:it.v}'"

Use @CompileStatic for the whole Gradle 2.1 project

Create a config groovyOptionsConfig.groovy:

withConfig(configuration) {

and use in in your build.gradle:

compileGroovy {
     groovyOptions.configurationScript = file("groovyOptionsConfig.groovy")