...and they shall know me by my speling errors.

Danno Ferrin (aka shemnon) on stuff that matters to him.

JavaFX Gradle Plugin 0.4.0 Released

Yesterday I pushed the fifth rerelease of my JavaFX Plugin for Gradle to BinTray, version 0.4.0. (Who came up wit the idea of zero indexed arrays anyway?) New in this release is the ability to specify a particular source set from which to package your runtime classes from. There were also a large number of bug fixes.

To use the plugin in your gradle script copy the following script into your root build directory:


and then load it in your build.gradle file like so:

apply from: ‘javafx.plugin’

This is a change from previous releases where I recommended you apply the script directly from the internet. But that doesn’t works so well on an airplane or other similarly air-gapped networks, particularly in places with poor wifi reception.

Specifying the Packaged Source Set

Sometimes your gradle project may have a large number of source sets you compile your java code from (where large is larger than 2). Often that means that the source set with the main class isn’t main. In previous versions of the plugin I assumed that main was the source set to use for packaging, now you can specify a different source set in the javafx block:

sourceSets {
  samples {
    java {
      compileClasspath += main.output
      runtimeClasspath += main.output
      runtimeClasspath += javadocJar.output

javafx {
    sourceSet = ‘samples’

But to be honest, I strongly recommend that your samples be placed in a separate sub project following the maven conventional tree structure. However since I am a strong advocate of choice in build tooling, you are now free to choose a different path than the opinion expressed by the build tool. But these opinions exist for your own good, trust us. ;) P

Bug fixes

Nearly all of the other changes revolve around bug fixes, mostly from ones I learned about in the bug queue. Keep them coming! One dealt with playing nicely with the gradle application plugin, one with specifying manifest entries, and there were some unreported ones I fixed in relation to jar files in the 7u40 java updates


If the plugin isn’t addressing your needs be sure to drop me a line on twitter at @shemnon or via Google+. Oh yea, there is still that e-mail thing too: danno dot ferrin at gmail or shemnon dot com. If my responses aren’t quick that is likely because I am playing LEGO Marvel Super Heroes on my legacy XBox 360 (which I won filling out conference surveys at JavaOne 5 years ago).