GithubHelp home page GithubHelp logo

openjfx / javafx-maven-plugin Goto Github PK

View Code? Open in Web Editor NEW
366.0 366.0 57.0 173 KB

Maven plugin to run JavaFX 11+ applications

License: Apache License 2.0

Java 95.60% Shell 4.40%
javafx javafx-11 javafx-maven-plugin javafx-modules maven-plugin openjfx

javafx-maven-plugin's Introduction

Maven plugin for JavaFX

Maven Central Travis CI Apache License

Maven plugin to run JavaFX 11+ applications

Install

The plugin is available via Maven Central.

In case you want to build and install the latest snapshot, you can clone the project, set JDK 11 and run

mvn install

Usage

Create a new Maven project, use an existing one like HelloFX, or use an archetype.

The project can be modular or non-modular.

JavaFX dependencies are added as usual:

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>12.0.2</version>
</dependency>

Add the plugin:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.8</version>
    <configuration>
        <mainClass>hellofx/org.openjfx.App</mainClass>
    </configuration>
</plugin>

Compile the project:

mvn compile

This step is optional and can be configured using the maven-compiler-plugin.

Run the project:

mvn javafx:run

For modular projects, create and run a custom image:

mvn javafx:jlink

target/image/bin/java -m hellofx/org.openjfx.App

javafx:run options

The plugin includes by default: --module-path, --add-modules and -classpath options.

Optionally, the configuration can be modified with:

  • mainClass: The main class, fully qualified name, with or without module name

  • workingDirectory: The current working directory

  • skip: Skip the execution. Values: false (default), true

  • outputFile: File to redirect the process output

  • options: A list of VM options passed to the executable.

  • commandlineArgs: Arguments separated by space for the executed program

  • includePathExceptionsInClasspath: When resolving the module-path, setting this value to true will include the dependencies that generate path exceptions in the classpath. By default, the value is false, and these dependencies won't be included.

  • runtimePathOption: By default, the plugin will place each dependency either on modulepath or on classpath (based on certain factors). When runtimePathOption configuration is set, the plugin will place all the dependencies on either modulepath or classpath.

    If set as MODULEPATH, a module descriptor is required. All dependencies need to be either modularized or contain an Automatic-Module-Name.

    If set as CLASSPATH, a Launcher class (like this one) is required to run a JavaFX application. Also, if a module-info descriptor is present, it will be ignored.

    Values: MODULEPATH or CLASSPATH.

This plugin supports Maven toolchains using the "jdk" tool.

Example

The following configuration adds some VM options, and a command line argument:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.8</version>
    <configuration>
        <mainClass>org.openjfx.hellofx/org.openjfx.App</mainClass>
        <options>
            <option>-Dbar=${bar}</option>
            <option>--add-opens</option>
            <option>java.base/java.lang=org.openjfx.hellofx</option>
        </options>
        <commandlineArgs>foo</commandlineArgs>
    </configuration>
</plugin>

When running maven with

mvn -Dbar=myBar javafx:run

it will be processed by the main method like:

public static void main(String[] args) {
    if (args.length > 0 && "foo".equals(args[0])) {
        // do something
    }
    if ("myBar".equals(System.getProperty("bar"))) {
        // do something
    }
    launch();
}

Note that the evaluation of System.getProperty("bar") can happen in any other place in the code.

Note

It is possible to use a local SDK instead of Maven Central. This is helpful for developers trying to test a local build of OpenJFX. Since transitive dependencies are not resolved, all the required jars needs to be added as a separate dependency, like:

<properties>
    <sdk>/path/to/javafx-sdk</sdk>
</properties>

<dependencies>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx.base</artifactId>
        <version>1.0</version>
        <scope>system</scope>
        <systemPath>${sdk}/lib/javafx.base.jar</systemPath>
    </dependency>
    ...
</dependencies>

javafx:jlink options

The same command line options for jlink can be set:

  • stripDebug: Strips debug information out. Values: false (default) or true
  • stripJavaDebugAttributes: Strip Java debug attributes out (since Java 13), Values: false (default) or true
  • compress: Compression level of the resources being used. Values: 0 (default), 1, 2.
  • noHeaderFiles: Removes the includes directory in the resulting runtime image. Values: false (default) or true
  • noManPages: Removes the man directory in the resulting runtime image. Values: false (default) or true
  • bindServices: Adds the option to bind services. Values: false (default) or true
  • ignoreSigningInformation: Adds the option to ignore signing information. Values: false (default) or true
  • jlinkVerbose: Adds the verbose option. Values: false (default) or true
  • launcher: Adds a launcher script with the given name.
    • If options are defined, these will be passed to the launcher script as vm options.
    • If commandLineArgs are defined, these will be passed to the launcher script as command line arguments.
  • jlinkImageName: The name of the folder with the resulting runtime image
  • jlinkZipName: When set, creates a zip of the resulting runtime image
  • jlinkExecutable: The jlink executable. It can be a full path or the name of the executable, if it is in the PATH.
  • jmodsPath: When using a local JavaFX SDK, sets the path to the local JavaFX jmods

For instance, with the following configuration:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.8</version>
    <configuration>
        <stripDebug>true</stripDebug>
        <compress>2</compress>
        <noHeaderFiles>true</noHeaderFiles>
        <noManPages>true</noManPages>
        <launcher>hellofx</launcher>
        <jlinkImageName>hello</jlinkImageName>
        <jlinkZipName>hellozip</jlinkZipName>
        <mainClass>hellofx/org.openjfx.MainApp</mainClass>
    </configuration>
</plugin>

A custom image can be created and run as:

mvn clean javafx:jlink

target/hello/bin/hellofx

Issues and Contributions

Issues can be reported to the Issue tracker.

Contributions can be submitted via Pull requests, providing you have signed the Gluon Individual Contributor License Agreement (CLA).

javafx-maven-plugin's People

Contributors

abhinayagarwal avatar alexfalappa avatar anthonyvdotbe avatar atdixon avatar betanzos avatar dependabot[bot] avatar geertjanw avatar gluon-bot avatar johanvos avatar jperedadnr avatar rfscholte avatar ryanthara avatar tbee avatar tiainen avatar ylyxf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

javafx-maven-plugin's Issues

Non-modular dependencies not found

The javafx-maven-plugin appears unable to see non-modular dependencies.

When called with mvn -X clean javafx:run and the following plugin configuration:

<plugin>
	<groupId>org.openjfx</groupId>
	<artifactId>javafx-maven-plugin</artifactId>
	<version>0.0.1</version>
	<configuration>
		<mainClass>uk.org.bobulous.java.myjavafxproject.MyJavaFXApplication</mainClass>
		<commandlineArgs>-Djdk.gtk.version=2</commandlineArgs>
	</configuration>
</plugin>

The build fails with errors that suggest that the modular project DependencyTDCX is visible to the build process, but the non-modular projects SkunkWorks, JavaUtilities, and DependencyXC are not found (even though their classpaths are shown in the "Classpath" section of the build output.

Output of mvn -X clean javafx:run is attached.

javafx-maven-plugin_error-trace.txt

Packaging a multi-platform JavaFX module app.

Hi there
This is not a bug report and the worse escenario would be a feature request.
first of all, excellent work done folks and the things in JavaFX are really getting stream-lined thanks to this project.
There is one feature I don't know how to get through it and it is the packaging of a multiplatform (win, mac, linux)module app from any of those platforms. This is solved pretty well using a non-modular project and the shade plugin and it works pretty well. However, is there any way to instruct the javafx:jlink task to produce an output, let say for running on windows from a mac machine?.
thank you

Add CI

Set Travis to build and publish the plugin from commits/tags.

Error: JavaFX runtime components are missing, and are required to run this application

JDK - OpenJDK 11 /using Intellij IDEA/

I already added javafx dependency to my pom.xml. But My jar file doesn't work.

I was trying to work my jar file by using that command.

java -jar cookorder.1.0.jar

But I got that error:

JavaFX runtime components are missing, and are required to run this application

How to solve that issue?

Pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>order.application</groupId>
    <artifactId>cookorder</artifactId>
    <version>1.0</version>
    <packaging>jar</packaging>
    <name>Cook order application</name>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.version>3.8.1</maven.compiler.version>
        <maven.shade.version>3.2.1</maven.shade.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <!-- logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.6.1</version>
        </dependency>

        <!-- converting -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.8.6</version>
        </dependency>

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.21</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>13</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>13</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.11</version>
        </dependency>
        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <version>19.3.0.0</version>
        </dependency>

        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>6.11.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <mainClass>Main</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
            </plugin>
            <!-- fat jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven.shade.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>Main</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

javafx:jlink goal requires manual compile

Unlike javafx:run, if javafx:jlink is executed without compile manually the project this goal fail

[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.4:jlink (default-cli) on project test-project: Error: Output directory is empty, compile first -> [Help 1]

Path exceptions are excluded from generated classpath

I necessarily depend on jar(s) with classes in the default java package. JavaFXBaseMojo uses LocationManager.resolvePaths to calculate the class- and module- paths. However when a jar dependency has classes in the default java package an exception is thrown by the LocationManager logic (as it attempts to infer dependency modules) and it records these exceptions in its result.getPathExceptions() -- the javafx-maven-plugin then subsequently omits these path exceptions from any of the class- and module- paths it generates for the java execution command-line.

One solution (proposed here: #17) would be to simply always include these path exceptions at the tail of the produced classpath. This seems the simplest approach. However we may wish to make this behavior enabled only by a configuration option, something such as includePathExceptionsInClasspath.

A broader solution would be to introduce configuration that allows users to exclude/include specific dependencies on the classpath or modulepath so as to override the inference done by the javafx-maven-plugin, though this would require a bit more work. (The maven-shade-plugin or maven-exec-plugin have examples/precedent for specifying artifact inclusions/exclusions type configuration for plugin configs.)

Dependency ignored when it contains default package

I have found that if a dependency contains code in the default package, it is not included in the running app.

Here is an example maven project that shows the problem. It depends on com.fimtra:clearconnect:3.16.0 (which contains code in the default package)
jfx-test.zip

Fatal Exception when executing javafx:run

Hello! I've been attempting to add the JavaFX plugin and dependencies to a project I've been working on; however, whenever I run my program, I am faced with a fatal error that prevents the JVM from starting:

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: --module-path

The full log is available here. I'm using Java 11.0.2 and javafx-maven-plugin 0.0.2.

Cannot find .jar in custom JRE

Hello, javafx-maven-plugin is a good plugin...
But after creating and runing custom jre several times I still cannot find the jar file anywhere in the target folder...
After some search i use mvn package to get the .jar out...
But I still cannot open the jar file by double clicking and also I cant find the libs(javafx controls, fxml) just as it was in javafx8...

Project Name : hellofx
Project Link : https://github.com/openjfx/samples/tree/master/IDE/IntelliJ/Modular/Maven/hellofx

System.getProperty(โ€œawt.toolkitโ€) is null when using javafx:run

here is code:

public class Test extends Application {
    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        System.out.println("AWT_TOOLKIT class name๏ผš" + System.getProperty("awt.toolkit"));
        System.out.println("user.timezone๏ผš" + System.getProperty("user.timezone"));

        primaryStage.show();
    }
}

when I run application in intellj idea directly, it will work well, print:

AWT_TOOLKIT class name๏ผšsun.awt.windows.WToolkit
user.timezone๏ผšAsia/Shanghai

but when I use javafx:run, it will print:

AWT_TOOLKIT class name๏ผšnull
user.timezone๏ผšnull

and I create runtime-image use jlink, and run launcher.bat, it will print:

AWT_TOOLKIT class name๏ผšnull
user.timezone๏ผšnull

how to do?

Cannot run application with weld-se

Hi,
I tried to add weld-se to my javafx application. The problem is that now I cannot run it with javafx:run goal. I can easily do it with exec:java, so I think there can be a problem with this plugin.

My module-info file is as follows:
module CdiApp { requires cdi.api; }

Using the above module config and main which starts a cdi container:
SeContainer container = SeContainerInitializer.newInstance().initialize();

I get:

org.jboss.weld.bootstrap.WeldStartup
INFO: WELD-000900: 3.1.1 (Final)
Exception in thread "main" java.lang.NoClassDefFoundError: javax/interceptor/Interceptor

So I excluded jboss-interceptor-api from weld-se-core and simply added direct dependency to javax.interceptors-api in pom.xml and requires javax.interceptors.api to module-info.java

Now I get:

Exception in thread "main" java.lang.IllegalStateException: WELD-ENV-000033: Invalid bean archive scanning result - found multiple results with the same reference: \NetBeansProjects\CdiApp\target\classes

Got null pointerException when running javafx:jlink

Hello running mvn javafx:jlink on my project I got the following NullpointerException
Caused by: java.lang.NullPointerException
at org.openjfx.JavaFXBaseMojo.getExecutablePath (JavaFXBaseMojo.java:368)
at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:154)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Any hints on what is going from ?

javafx:jlink does not support springboot

Hi~๏ผŒI tried to use the springboot framework๏ผˆver2.2.1๏ผ‰ to build JavaFX๏ผˆver13.0.1๏ผ‰ applications with JDK11๏ผŒbut when I used the plugin's javafx:jlink command, the following error occurred๏ผŒand I hava a module-info.java in my root package and requires the Spring components๏ผŒlike spirng.core.........

`[INFO]
[INFO] --- javafx-maven-plugin:0.0.3:jlink (default-cli) @ fxboot-samples ---
Error: automatic module cannot be used from spring-core-5.2.1.RELEASE.jar jlink_ spring.core
[ERROR] Command execution failed.
Command execution failed.

org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:491)
at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:453)
at org.openjfx.JavaFXJLinkMojo.execute (JavaFXJLinkMojo.java:183)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
at org.codehaus.classworlds.Launcher.main (Launcher.java:47)
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:491)
at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:453)
at org.openjfx.JavaFXJLinkMojo.execute(JavaFXJLinkMojo.java:183)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:192)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)`

So, is this a plugin bug or does springboot not support the javafx:jlink command? my project is here๏ผš https://github.com/yan1989/fxboot

Test failures when compiling master - ArtifactResolutionException

Hi,

I'm attempting to build this plugin from the master branch but having issues running the tests.

I've tried deleting all org/openjfx depenedencies in my local .m2 and I've ensured my own local artifact repo contains the artifacts needed, org.openjfx:javafx-controls:jar:12.0.1 for the case below.

Any ideas?

Thanks,

Stephen

~/Development/repos/javafx-maven-plugin (master)$ java -version
openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3+7, mixed mode)
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Error translating Commandline.
Running org.openjfx.JavaFXRunMojoTestCase
[debug] Executable [20312634-1d3d-4036-91f4-533f6be14a7d]
[debug] Executing command line: [20312634-1d3d-4036-91f4-533f6be14a7d, --version]
org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.openjfx:javafx-controls:jar:12.0.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:413)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:215)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifacts(DefaultRepositorySystem.java:255)
	at org.openjfx.MavenArtifactResolver.resolve(MavenArtifactResolver.java:106)
	at org.openjfx.JavaFXRunMojoTestCase.lambda$getJavaFXRunMojo$1(JavaFXRunMojoTestCase.java:129)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.openjfx.JavaFXRunMojoTestCase.getJavaFXRunMojo(JavaFXRunMojoTestCase.java:130)
	at org.openjfx.JavaFXRunMojoTestCase.testApplicationRun(JavaFXRunMojoTestCase.java:111)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.openjfx:javafx-controls:jar:12.0.1 from/to central (https://repo.maven.apache.org/maven2): connect timed out
	at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
	at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:489)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:390)
	... 39 more
Caused by: java.net.SocketTimeoutException: connect timed out
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:591)
	at java.base/sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:285)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:524)
	at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403)
	at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
	at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:304)
	at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
	at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:158)
	at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:318)
	at org.eclipse.aether.transport.http.HttpTransporter.implPeek(HttpTransporter.java:262)
	at org.eclipse.aether.spi.connector.transport.AbstractTransporter.peek(AbstractTransporter.java:51)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PeekTaskRunner.runTask(BasicRepositoryConnector.java:376)
	at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
	... 44 more
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 12.978 sec <<< FAILURE!
testApplicationRun(org.openjfx.JavaFXRunMojoTestCase)  Time elapsed: 10.494 sec  <<< ERROR!
java.lang.NullPointerException
	at org.openjfx.JavaFXRunMojoTestCase.lambda$getJavaFXRunMojo$1(JavaFXRunMojoTestCase.java:129)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:271)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
	at org.openjfx.JavaFXRunMojoTestCase.getJavaFXRunMojo(JavaFXRunMojoTestCase.java:130)
	at org.openjfx.JavaFXRunMojoTestCase.testApplicationRun(JavaFXRunMojoTestCase.java:111)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at junit.framework.TestCase.runTest(TestCase.java:176)
	at junit.framework.TestCase.runBare(TestCase.java:141)
	at junit.framework.TestResult$1.protect(TestResult.java:122)
	at junit.framework.TestResult.runProtected(TestResult.java:142)
	at junit.framework.TestResult.run(TestResult.java:125)
	at junit.framework.TestCase.run(TestCase.java:129)
	at junit.framework.TestSuite.runTest(TestSuite.java:252)
	at junit.framework.TestSuite.run(TestSuite.java:247)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Results :

Tests in error: 
  testApplicationRun(org.openjfx.JavaFXRunMojoTestCase)

Tests run: 3, Failures: 0, Errors: 1, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.630 s
[INFO] Finished at: 2019-07-12T11:26:39+10:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project javafx-maven-plugin: There are test failures.
[ERROR] 
[ERROR] Please refer to /home/sxo/Development/repos/javafx-maven-plugin/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Allow to run the application fully in the classpath

I has been develop this cross-platform application skeleton but I have problems to run it with javafx:run because this MOJO always add the javafx's JAR files in the modulepath.

Windows example command executed by javafx:run

> D:\tools\java\adoptopenjdk-11.0.4+11_hotspot\bin\java.exe
	--module-path
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-win.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-win.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-win.jar
	--add-modules
		javafx.base,
		javafx.base,
		javafx.base,
		javafx.controls,
		javafx.controls,
		javafx.controls,
		javafx.graphics,
		javafx.graphics,
		javafx.graphics
	-classpath
		C:\Users\Betanzos\Desktop\cross-platform-app-fx\target\classes
	com.betanzos.Main

This may cause some problems due to overlapping modules (duplicated) which are not reloaded. For example, when I run the app in Windows, only the JAR javafx-graphics-14-linux.jar are loaded as javafx.graphics module so Windows libs are missing and the app exits (if I run the app in linux work fine).

We can see the problem if run the app adding the JVM parameter --show-module-resolution (below output exclude all non related modules for simplicity):

...
root javafx.base file:///D:/tools/maven-repository/org/openjfx/javafx-base/14/javafx-base-14-linux.jar
...
root javafx.controls file:///D:/tools/maven-repository/org/openjfx/javafx-controls/14/javafx-controls-14-linux.jar
...
root javafx.graphics file:///D:/tools/maven-repository/org/openjfx/javafx-graphics/14/javafx-graphics-14-linux.jar
...
root javafx.fxml file:///D:/tools/maven-repository/org/openjfx/javafx-fxml/11.0.2/javafx-fxml-11.0.2-win.jar
...
javafx.fxml requires javafx.graphics file:///D:/tools/maven-repository/org/openjfx/javafx-graphics/14/javafx-graphics-14-linux.jar
javafx.fxml requires javafx.base file:///D:/tools/maven-repository/org/openjfx/javafx-base/14/javafx-base-14-linux.jar
javafx.fxml requires java.scripting jrt:/java.scripting
javafx.fxml requires java.xml jrt:/java.xml
...
javafx.graphics requires java.desktop jrt:/java.desktop
javafx.graphics requires javafx.base file:///D:/tools/maven-repository/org/openjfx/javafx-base/14/javafx-base-14-linux.jar
javafx.graphics requires java.xml jrt:/java.xml
javafx.graphics requires jdk.unsupported jrt:/jdk.unsupported
...
javafx.controls requires javafx.base file:///D:/tools/maven-repository/org/openjfx/javafx-base/14/javafx-base-14-linux.jar
javafx.controls requires javafx.graphics file:///D:/tools/maven-repository/org/openjfx/javafx-graphics/14/javafx-graphics-14-linux.jar
...
javafx.base requires java.desktop jrt:/java.desktop
...

Having said that it would be useful to add a way to run the application fully on the classpath.

Windwos command we want to execute with javafx:run

> D:\tools\java\adoptopenjdk-11.0.4+11_hotspot\bin\java.exe
	-classpath
		C:\Users\Betanzos\Desktop\cross-platform-app-fx\target\classes;
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-base\14\javafx-base-14-win.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-controls\14\javafx-controls-14-win.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-linux.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-mac.jar;
		D:\tools\maven-repository\org\openjfx\javafx-graphics\14\javafx-graphics-14-win.jar;
		C:\Users\Betanzos\Desktop\cross-platform-app-fx\target\classes
	com.betanzos.Main

Making jar file

Hi
Can u provide a guide in main page for creating executable jar file?
I have tried to package my application in a jar file but i get this error when opening jar file in windows.
Error: JavaFX runtime components are missing, and are required to run this application

Missing link vm options parameter

jlink tool allows some VM options and the launcher has an option for it, like:

JLINK_VM_OPTIONS="--add-opens javafx.graphics/com.sun.glass.ui=fx"

The plugin configuration should add it.

Automatic compilation option

Currently when running mvn javafx:run, the plugin compiles if there is no initial compilation (target/classes doesn't exist).

Later on, any change in the source code is not tracked and requires running mvn javafx:compile javafx:run.

Ideally, the plugin could have an option to allow automatic compilation, and when enabled it will call compile only when required.

<options> definition cannot be generated in bin/laucher.bat for windows but bin/launch in linux

<plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <options>
                        <option>--add-exports</option>
                        <option>java.base/jdk.internal.org.objectweb.asm=xxx</option>
                    </options>
                    <commandlineArgs>-Xmx1024m</commandlineArgs>
                    <jlinkImageName>hello</jlinkImageName>
                    <jlinkZipName>hellozip</jlinkZipName>
                    <launcher>launcher</launcher>
                    <mainClass>jfx.JFXMain</mainClass>
                </configuration>
            </plugin>


-------- windows version --------------
@echo off
set JLINK_VM_OPTIONS=
set DIR=%~dp0
"%DIR%\java" %JLINK_VM_OPTIONS% -m xxx/jfx.JFXMain %*

---------- linux version -------------
#!/bin/sh
JLINK_VM_OPTIONS="--add-exports java.base/jdk.internal.org.objectweb.asm=xxx"
DIR=`dirname $0`
$DIR/java $JLINK_VM_OPTIONS -m xxx/jfx.JFXMain "$@"

Problem when execute generated JAR

Hi,

Im getting error when execute my generated JAR:

java -jar target/JRPrintPreview-0.1-SNAPSHOT.jar 

Error:

java -jar target/JRPrintPreview-0.1-SNAPSHOT.jar 
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes
	at java.base/sun.security.util.SignatureFileVerifier.processImpl(SignatureFileVerifier.java:336)
	at java.base/sun.security.util.SignatureFileVerifier.process(SignatureFileVerifier.java:269)
	at java.base/java.util.jar.JarVerifier.processEntry(JarVerifier.java:316)
	at java.base/java.util.jar.JarVerifier.update(JarVerifier.java:230)
	at java.base/java.util.jar.JarFile.initializeVerifier(JarFile.java:758)
	at java.base/java.util.jar.JarFile.ensureInitialization(JarFile.java:1035)
	at java.base/java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
	at java.base/jdk.internal.loader.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:870)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:788)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:415)
	at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:760)
	at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)

I made a demo that can be used to test:
https://github.com/prsolucoes/jrprintpreview

Test:

mvn clean compile package
java -jar target/JRPrintPreview-0.1-SNAPSHOT.jar 

Can anyone help me?

Missing native libs in custom JRE

After execute javafx:jlink on windows in bin folder missing native libs from javafx.graphics.jmod:

decora_sse.dll
glass.dll
javafx_font.dll
javafx_iio.dll
prism_common.dll
prism_d3d.dll
prism_sw.dll

Support for maven-shade-plugin and launch4j-maven-plugin

Hi,

If you take a look at https://github.com/StegmannSystems/javafx.demo you can see that your mechanism mvnw clean javafx:run works fine. However that's just interesting for the purpose of testing.

See the following problem:

C:\Checkouts\javafx.demo>java -jar target\javafx-demo-0.0.1-SNAPSHOT-shaded.jar
Error: JavaFX runtime components are missing, and are required to run this application

I can solve it like this:

C:\Checkouts\javafx.demo>java --module-path c:\tools\javafx-sdk-11.0.2\lib  --add-modules=javafx.controls,javafx.fxml,javafx.web,javafx.media -jar target\javafx-demo-0.0.1-SNAPSHOT-shaded.jar

The main point here is that I already fetched all Java FX dependencies via pom.xml and I shouldn't be forced to specify those two parameters (at least not the module path). Do you have any clever trick on how this can be done more comfortable for maven-shade-plugin and launch4j (at least javafx:run seems to know)?

Prefer executable in JAVA_HOME when defined

It would be great to prefer the java executable found in a user explicitly defined JAVA_HOME.

I had an issue on a centrally managed Windows 10 system where an Oracle JRE 8 was defined in the system path and I couldn't override it by redefining the PATH in the local user account environment variables definition, this prevented execution of maven javafx:run for example with missing --modulepath error.

At the moment a java is found in the system executable path is chosen, the following two blocks should be flipped:

if (exec == null && OS.isFamilyWindows()) {
List<String> paths = this.getExecutablePaths(enviro);
paths.add(0, dir.getAbsolutePath());
exec = findExecutable(executable, paths);
}
if (exec == null) {
String javaHome = System.getProperty("java.home", getJavaHome(enviro));
if (javaHome != null && ! javaHome.isEmpty()) {
exec = findExecutable(executable, Arrays.asList(javaHome.concat(File.separator).concat("bin")));
}
}

compilerArgs do not work

The readme mentions that compilerargs can be set in the configuration, but compilerargs are ignored. If I add the config below:

 <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4-SNAPSHOT</version>
                <configuration>
                    <compilerArgs>
                        <arg>--add-exports</arg>
               <arg>javafx.graphics/com.sun.javafx.perf=de.smartaccesssolutions.pulselogger</arg>
                    </compilerArgs>
                    <mainClass>de.smartaccesssolutions.pulselogger.App</mainClass>
                </configuration>
                
            </plugin>

I'll get:

de/smartaccesssolutions/pulselogger/App.java:[10,21] package com.sun.glass.ui is not visible
  (package com.sun.glass.ui is declared in module javafx.graphics, which does not export it to module de.smartaccesssolutions.pulselogger)

Whereas if I disable the openjfx plugin and instead configure the maven-compiler-plugin it compiles fine:

        <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.8.0</version>

                  <configuration>
                      <compilerArgs>
                          <arg>--add-exports</arg>
                          <arg>javafx.graphics/com.sun.glass.ui=de.smartaccesssolutions.pulselogger</arg>
                      </compilerArgs>
                      <release>11</release>
                  </configuration>
          </plugin>

Options for javafx:run are incompatible with javafx:jlink

For instance, adding:

                    <options>
                        <option>--add-opens</option>
                        <option>javafx.graphics/com.sun.glass.ui=fx</option>
                    </options>

that works for mvn javafx:run, fails for mvn javafx:jlink with:

INFO] --- javafx-maven-plugin:0.0.2:jlink (default-cli) @ fx ---
Error: unknown option: --add-opens
Usage: jlink <options> --module-path <modulepath> --add-modules <module>[,<module>...]
Use --help for a list of possible options

Unable to run JavaFX via Maven

I'm using the code provided at:
https://github.com/openjfx/samples/tree/master/HelloFX/Maven

I did set the JAVA_HOME environment variable to point to Java 13.0.1.

However I get the following exception:

C:_dev\NetBeansProjects\hellofx>echo %JAVA_HOME%
C:_dev\jdk-13.0.1
C:_dev\NetBeansProjects\hellofx>mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:_tools\apache-maven-3.6.3\bin..
Java version: 13.0.1, vendor: Oracle Corporation, runtime: C:_dev\jdk-13.0.1
Default locale: en_ZA, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

C:_dev\NetBeansProjects\hellofx>mvn clean javafx:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< org.openjfx:hellofx >-------------------------
[INFO] Building demo 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ hellofx ---
[INFO] Deleting C:_dev\NetBeansProjects\hellofx\target
[INFO]
[INFO] --- javafx-maven-plugin:0.0.3:run (default-cli) @ hellofx ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:_dev\NetBeansProjects\hellofx\src\main\resources
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:_dev\NetBeansProjects\hellofx\target\classes
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Unrecognized option: --module-path
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:491)
at org.openjfx.JavaFXBaseMojo.executeCommandLine (JavaFXBaseMojo.java:453)
at org.openjfx.JavaFXRunMojo.execute (JavaFXRunMojo.java:97)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:491)
at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:453)
at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:97)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.226 s
[INFO] Finished at: 2019-11-27T12:39:26+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.3:run (default-cli) on project hellofx: Error: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I also tried a variety of things using the sample project provided by NetBeans, but couldn't get it running.

[WARNING] Can't extract module name from X

Hi! I'm using DeepLearing4J with OpenJFX. It works great, but when I compile or run, I get these warnings. I don't have the module-info.java file in my project.

[INFO] --- javafx-maven-plugin:0.0.3:run (default-cli) @ JNonlinearControl ---
[WARNING] Can't extract module name from nd4j-native-api-1.0.0-beta4.jar: nd4j.native.api: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from protobuf-java-shaded-351-0.9.jar: protobuf.java.shaded.351: Invalid module name: '351' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4-linux-x86_64.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from protobuf-java-util-shaded-351-0.9.jar: protobuf.java.util.shaded.351: Invalid module name: '351' is not a Java identifier
[WARNING] Can't extract module name from nd4j-native-1.0.0-beta4.jar: nd4j.native: Invalid module name: 'native' is not a Java identifier
[WARNING] Can't extract module name from datavec-data-image-1.0.0-beta4.jar: Provider class com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderSpi not in module
[WARNING] Some dependencies encountered issues while attempting to be resolved as modules and will not be included in the classpath; you can change this behavior via the  'includePathExceptionsInClasspath' configuration parameter.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  42.043 s
[INFO] Finished at: 2019-07-27T01:23:58+02:00
[INFO] ------------------------------------------------------------------------

Yes, slow computer.

I'm using OpenJDK 11.0.3 and OpenJFX 11.0.2

asus@asus-pc:~$ java --version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu219.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu219.04.1, mixed mode, sharing)
asus@asus-pc:~$ 

And this is my pom.xml file

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>se.danielmartensson</groupId>
	<artifactId>JNonlinearControl</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-controls</artifactId>
			<version>11.0.2</version>
		</dependency>
		<dependency>
			<groupId>org.openjfx</groupId>
			<artifactId>javafx-fxml</artifactId>
			<version>11.0.2</version>
		</dependency>
		<dependency>
			<groupId>org.datavec</groupId>
			<artifactId>datavec-api</artifactId>
			<version>1.0.0-beta4</version>
		</dependency>
		<dependency>
			<groupId>org.nd4j</groupId>
			<artifactId>nd4j-native</artifactId>
			<version>1.0.0-beta4</version>
		</dependency>
		<dependency>
			<groupId>org.deeplearning4j</groupId>
			<artifactId>deeplearning4j-core</artifactId>
			<version>1.0.0-beta4</version>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<release>11</release>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.openjfx</groupId>
				<artifactId>javafx-maven-plugin</artifactId>
				<version>0.0.3</version>
				<configuration>
					<mainClass>se.danielmartensson.JNonlinearControl.Main</mainClass>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
					<archive>
					  <manifest>
						<mainClass>se.danielmartensson.JNonlinearControl.Main</mainClass>
					  </manifest>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

Unable to run profiler

I'm using an IDE, it provide a property, ${vm.args} that I try to use with the javafx-maven-plugin like:

    <execution>
        <!-- Configuration for automatic IDE profiling -->
        <id>ide-profile</id>
        <configuration>
            <options>
                <option>${vm.args}</option>
            </options>
            <mainClass>com.raelity.play.xs13.App</mainClass>
        </configuration>
    </execution>

Typically vm.args looks like -XX:+He... -XX:Hea... -agentp... and it gets treated as a single jvm argument which fails. It needs to be split by whitespace.

I could be missing the right way to do this. I was wondering about extending the plugin; something like:
<optionsString><string>${vm.args}</string></optionsString>
which would split the string, by default on white space, and add the resulting list to vm options.

BTW, manually taking the value of ${vm.args} and adding them separately as <option>arg</option> works and the profiler run OK.

Error occurred during initialization of boot layer

Hi guys, i am stuck in making JavaFX program with Hadoop FS. I use Maven, JDK 11 and JavaFX 12. I think it has trouble when maven tries to add hadoop module to parameter behind javafx:run command.
This is my pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.vn.somegroup</groupId>
    <artifactId>DemoHadoopFiles</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-fxml</artifactId>
            <version>12.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>12.0.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-client -->
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>3.2.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common -->
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>3.2.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.2</version>
                <configuration>
                    <mainClass>HelloFX</mainClass>
                    <source>11</source>
                    <target>11</target>
                    <release>11</release>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

And this is console log when run with command "mvn clean javafx:run -X"

"C:\Program Files\Java\jdk-11.0.1\bin\java.exe" -Dmaven.multiModuleProjectDirectory=D:\IT\IdeaProjects\DemoHadoopFiles "-Dmaven.home=D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\plugins\maven\lib\maven3" "-Dclassworlds.conf=D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\plugins\maven\lib\maven3\bin\m2.conf" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\lib\idea_rt.jar=50230:D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\bin" -Dfile.encoding=UTF-8 -classpath "D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\plugins\maven\lib\maven3\boot\plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version2019.1.1 clean javafx:run -X
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T23:41:47+07:00)
Maven home: D:\Program Files\JetBrains\IntelliJ IDEA 2018.2.5\plugins\maven\lib\maven3
Java version: 11.0.1, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk-11.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
[INFO] Scanning for projects...
[DEBUG] Tasks:   [clean, javafx:run]
[DEBUG] Style:   Regular
[DEBUG] =======================================================================
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building DemoHadoopFiles 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <directory default-value="${project.build.directory}"/>
  <excludeDefaultDirectories default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
  <failOnError default-value="true">${maven.clean.failOnError}</failOnError>
  <followSymLinks default-value="false">${clean.followSymLinks}</followSymLinks>
  <outputDirectory default-value="${project.build.outputDirectory}"/>
  <reportDirectory default-value="${project.reporting.outputDirectory}"/>
  <retryOnError default-value="true">${maven.clean.retryOnError}</retryOnError>
  <skip default-value="false">${clean.skip}</skip>
  <testOutputDirectory default-value="${project.build.testOutputDirectory}"/>
  <verbose>${clean.verbose}</verbose>
</configuration>
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal:          org.openjfx:javafx-maven-plugin:0.0.2:run (default-cli)
[DEBUG] Style:         Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <async default-value="false">${javafx.async}</async>
  <asyncDestroyOnShutdown default-value="true">${javafx.asyncDestroyOnShutdown}</asyncDestroyOnShutdown>
  <basedir default-value="${basedir}"/>
  <builddir default-value="${project.build.directory}"/>
  <commandlineArgs>${javafx.args}</commandlineArgs>
  <compilePath default-value="${project.compileClasspathElements}"/>
  <executable default-value="java">${javafx.executable}</executable>
  <mainClass>HelloFX</mainClass>
  <outputFile>${javafx.outputFile}</outputFile>
  <project default-value="${project}"/>
  <release default-value="11">11</release>
  <session default-value="${session}"/>
  <skip default-value="false">${javafx.skip}</skip>
  <source default-value="11">11</source>
  <target default-value="11">11</target>
  <workingDirectory>${javafx.workingDirectory}</workingDirectory>
</configuration>
[DEBUG] =======================================================================
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=2, ConflictMarker.markTime=1, ConflictMarker.nodeCount=577, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=116, ConflictIdSorter.conflictIdCycleCount=4, ConflictResolver.totalTime=8, ConflictResolver.conflictItemCount=217, DefaultDependencyCollector.collectTime=536, DefaultDependencyCollector.transformTime=14}
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ DemoHadoopFiles ---
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.5:clean' with basic configurator -->
[DEBUG]   (f) directory = D:\IT\IdeaProjects\DemoHadoopFiles\target
[DEBUG]   (f) excludeDefaultDirectories = false
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) followSymLinks = false
[DEBUG]   (f) outputDirectory = D:\IT\IdeaProjects\DemoHadoopFiles\target\classes
[DEBUG]   (f) reportDirectory = D:\IT\IdeaProjects\DemoHadoopFiles\target\site
[DEBUG]   (f) retryOnError = true
[DEBUG]   (f) skip = false
[DEBUG]   (f) testOutputDirectory = D:\IT\IdeaProjects\DemoHadoopFiles\target\test-classes
[DEBUG] -- end configuration --
[INFO] Deleting D:\IT\IdeaProjects\DemoHadoopFiles\target
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status\maven-compiler-plugin\compile\null\inputFiles.lst
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status\maven-compiler-plugin\compile\null\createdFiles.lst
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status\maven-compiler-plugin\compile\null
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status\maven-compiler-plugin\compile
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status\maven-compiler-plugin
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\maven-status
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\generated-sources\annotations
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\generated-sources
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\classes\sample.fxml
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\classes\HelloFX.class
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\classes\FSManager.class
[INFO] Deleting file D:\IT\IdeaProjects\DemoHadoopFiles\target\classes\Controller.class
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target\classes
[INFO] Deleting directory D:\IT\IdeaProjects\DemoHadoopFiles\target
[DEBUG] Skipping non-existing directory D:\IT\IdeaProjects\DemoHadoopFiles\target\classes
[DEBUG] Skipping non-existing directory D:\IT\IdeaProjects\DemoHadoopFiles\target\test-classes
[DEBUG] Skipping non-existing directory D:\IT\IdeaProjects\DemoHadoopFiles\target\site
[INFO] 
[INFO] --- javafx-maven-plugin:0.0.2:run (default-cli) @ DemoHadoopFiles ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=160, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=59, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=2, ConflictResolver.conflictItemCount=102, DefaultDependencyCollector.collectTime=206, DefaultDependencyCollector.transformTime=2}
[DEBUG]   (f) executable = java
[DEBUG]   (f) mainClass = HelloFX
[DEBUG]   (f) release = 11
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@22752544
[DEBUG]   (f) skip = false
[DEBUG]   (f) source = 11
[DEBUG]   (f) target = 11
[DEBUG] -- end configuration --
[DEBUG] Output directory was empty, compiling...
[DEBUG] Running executeMojo for Plugin [org.apache.maven.plugins:maven-resources-plugin]
[DEBUG] Attempting to load plugin Plugin [org.apache.maven.plugins:maven-resources-plugin] using pluginManager org.apache.maven.plugin.DefaultBuildPluginManager@51d719bc and repositories [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=77, ConflictIdSorter.graphTime=1, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=26, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=74, DefaultDependencyCollector.collectTime=55, DefaultDependencyCollector.transformTime=1}
[DEBUG]   (f) supportMultiLineFiltering = false
[DEBUG]   (f) useBuildFilters = true
[DEBUG]   (s) useDefaultDelimiters = true
[DEBUG] -- end configuration --
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[DEBUG] resource with targetPath null
directory D:\IT\IdeaProjects\DemoHadoopFiles\src\main\resources
excludes []
includes []
[DEBUG] ignoreDelta true
[INFO] Copying 1 resource
[DEBUG] file sample.fxml has a filtered file extension
[DEBUG] copy D:\IT\IdeaProjects\DemoHadoopFiles\src\main\resources\sample.fxml to D:\IT\IdeaProjects\DemoHadoopFiles\target\classes\sample.fxml
[DEBUG] no use filter components
[DEBUG] Running executeMojo for Plugin [org.apache.maven.plugins:maven-compiler-plugin]
[DEBUG] Attempting to load plugin Plugin [org.apache.maven.plugins:maven-compiler-plugin] using pluginManager org.apache.maven.plugin.DefaultBuildPluginManager@51d719bc and repositories [central (https://repo.maven.apache.org/maven2, default, releases)]
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=118, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=45, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=1, ConflictResolver.conflictItemCount=72, DefaultDependencyCollector.collectTime=100, DefaultDependencyCollector.transformTime=1}
Error occurred during initialization of boot layer
**java.lang.module.ResolutionException: Modules hadoop.yarn.common and hadoop.yarn.client export package org.apache.hadoop.yarn.client.api to module paranamer
[ERROR] Command execution failed.**
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:447)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:409)
	at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:97)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.947 s
[INFO] Finished at: 2019-06-06T12:05:46+07:00
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:447)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:409)
	at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:97)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
[INFO] Final Memory: 19M/64M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.2:run (default-cli) on project DemoHadoopFiles: Error: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.2:run (default-cli) on project DemoHadoopFiles: Error
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error
	at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:114)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 21 more
Caused by: org.apache.maven.plugin.MojoExecutionException: Command execution failed.
	at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:108)
	... 23 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:447)
	at org.openjfx.JavaFXBaseMojo.executeCommandLine(JavaFXBaseMojo.java:409)
	at org.openjfx.JavaFXRunMojo.execute(JavaFXRunMojo.java:97)
	... 23 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1

Many thanks!

javafx:compile doesnt exist

Your documentation:
"mvn javafx:compile"

Console output:
Could not find goal 'compile' in plugin org.openjfx:javafx-maven-plugin:0.0.4 among available goals jlink, run -> [Help 1]

Add jlink goal

Based on the existing JavaFXRunMojo, adding JavaFXLinkMojo should be fairly easy, allowing to run javafx:jlink to produce a custom image.

Java 14 preview seems not to be working properly

Hello,

I just set up a project and I need to try textblock. I wrote the following pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.kearny</groupId>
    <artifactId>rope</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>RopeTextEditor</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>14</maven.compiler.source>
        <maven.compiler.target>14</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>14.0.1</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.openjfx</groupId>
                <artifactId>javafx-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <source>14</source>
                    <target>14</target>
                    <release>14</release>
                    <mainClass>com.kearny.rope.RopeTextEditor</mainClass>
                    <commandlineArgs>--enable-preview</commandlineArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

With the following java class only:

package com.kearny.rope;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class RopeTextEditor extends Application {

   @Override
   public void start(Stage stage) throws Exception {
       var javaVersion = System.getProperty("java.version");
       var javafxVersion = System.getProperty("javafx.version");
       var label = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
       var scene = new Scene(new StackPane(label), 640, 480);
       stage.setScene(scene);
       stage.show();

       Object test = """
               <html>
                   <body>
                       <p>Hello, world</p>
                   </body>
               </html>
               """;

       if (test instanceof String) {
           System.out.println(test);
       } else {
           System.out.println(test);
       }
   }

   public static void main(String[] args) {
       launch(args);
   }
}

I get this error: Error:(20,23) java: text blocks are a preview feature and are disabled by default.

Is there something wrong with my configuration ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.