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.

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

Use .netrc from within Grails BuildConfig.groovy

With the switch from ivy to aether providing credentials to Basic-Auth protected internal maven repos according to documentation needs the credentials in the BuildConfig.groovy. Not much saver, but at least not in the repo you can use the content of your .netrc quite easy with a small helper. Add this script in your BuildConfig.groovy:

// parse a valid .netrc and provide the content as netrc.<machine>.key = value
def netrc = [:]
def netrcFile = new File("${System.getProperty('user.home')}/.netrc")
if (netrcFile.exists()) {
        lastMachine = null
                it.split().collect{ it.trim() }.with{
                        if (it.size()>1) {
                                switch (it[0]) {
                                case 'machine': lastMachine = it[1]; netrc.put(lastMachine, [:]); break
                                default: netrc."$lastMachine".put(it[0],it[1])

And then you can use it along with the mavenRepo:

def inhouseHost = ''
            username: netrc."${inhouseHost}".login,
            password: netrc."${inhouseHost}".password,

Toggle JDK in Gentoo

function jdk {
        export GENTOO_VM=oracle-jdk-bin-1.$1
        export JDK_HOME=/usr/lib/jvm/oracle-jdk-bin-1.$1
        export JAVA_HOME=/usr/lib/jvm/oracle-jdk-bin-1.$1
        java -version

e.g. jdk 8