0

I have been looking at this gradle plugin from https://bintray.com/shemnon/javafx-gradle/gradle-javafx-plugin/view

The method for using it is

 apply from: 'http://dl.bintray.com/content/shemnon/javafx-gradle/8.1.1/javafx.plugin'

My question is how secure is this. Could it become unavailable next month and leave me scrambling for another solution? I cant find a way to download it and store a local copy. Am I misunderstanding how grade works? What if the server goes down, will I be unable to work until it is back up?

Rob
  • 2,511
  • 2
  • 20
  • 31
  • This plugin's last updated version was **8.1.1** which was released on **Aug 27, 2014**. Since, this is not actively developed anymore, any bugs that you face while using this will most likely never get fixed. Therefore, I would recommend to not use the plugin. Additionally, since javafx is already bundled with jdk, I am skeptical on why do you need a plugin anymore. – ItachiUchiha Jan 30 '16 at 07:06
  • It is supposed to make it easier to create a install-able javafx package. Supposed being the key word. I can't find any documentation on how this is supposed to work so have given up on this. – Rob Jan 30 '16 at 08:45
  • You can do it using many different ways, some of them are listed here - [What is the best way to deploy JavaFX application, create JAR and self-contained applications and native installers](http://stackoverflow.com/questions/30145772/what-is-the-best-way-to-deploy-javafx-application-create-jar-and-self-contained/30162808#30162808) – ItachiUchiha Jan 30 '16 at 11:45
  • Yes I have been looking at that. I want to use gradle rather than ant or maven, no real reason other than because that is what I want. :-) So I'll have a look at this latter today: https://github.com/johnrengelman/shadow – Rob Jan 30 '16 at 17:10
  • In t he end I went with another direction which I will leave here just in case it is useful for someone following a similar path. – Rob Jan 30 '16 at 20:42

2 Answers2

2

The plugin you were looking is no longer supported, as you can see in the last comment the author posted of this issue:

https://bitbucket.org/shemnon/javafx-gradle/issues/49/documentation-and-a-working-sample

I found the following project and it's kinda working, it needs some tweaks for a multiple modules project:

https://github.com/FibreFoX/javafx-gradle-plugin

This guy seems to be active on the project nowadays, the lack of documentation is an issue but still you can deploy your JavaFX project, I tried creating a DMG package for Mac, you will have to try the same thing with Windows.

** UPDATE ** It seems that FibreFox is no longer active, but the project isn't dead according to the author: "No, this plugin is not (yet) dead, but the future got very fragile." for more details: https://github.com/FibreFoX/javafx-gradle-plugin/issues/119

Thanks to @Some Guy in the comments section below.

moxi
  • 1,390
  • 20
  • 21
  • 1
    FYI, the author of this plugin (the FibreFoX one) has said that as of April 2018, the current version is being retired (he is not working on it anymore), and that he is privately working on a new one, with no definite expected release date. See github.com/FibreFoX/javafx-gradle-plugin/issues/119 for details. – Some Guy Dec 02 '18 at 09:55
0

This is not exactly an answer to my original question, but ultimately what I was looking at the plugin for was a way to make an exe installer with gradle. In the end I stuck with the normal gradle stuff and used this in my build.gradle. Maybe this will save some one else a half day with google.

// create a single Jar with all dependencies
task fatJar(type: Jar) {
    doFirst {
        from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    }
    exclude 'META-INF/*.RSA', 'META-INF/*.SF','META-INF/*.DSA'
    manifest {
        attributes 'Implementation-Title': appName,
                'Implementation-Version': version,
                'Main-Class': mainClassName
    }
    baseName = project.name
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

// create a windows .exe installer
task buildPackage << {
    if (jdk != null && !jdk.isEmpty()) {
        def javapackager = exec {
            workingDir "${project.projectDir.absolutePath}"
            commandLine "${jdk}\\bin\\javapackager",
                    "-deploy",
                    "-title", appName,
                    "-native", "exe",
                    "-name", appName,
                    "-outdir", "${buildDir.name}${File.separator}dist",
                    "-outfile", appName,
                    "-srcdir", "${buildDir.name}${File.separator}libs",
                    "-appclass", mainClassName
        }
    }
}
Rob
  • 2,511
  • 2
  • 20
  • 31