{"id":13798666,"url":"https://github.com/openjfx/javafx-maven-plugin","last_synced_at":"2025-04-04T11:12:35.443Z","repository":{"id":36124777,"uuid":"173197405","full_name":"openjfx/javafx-maven-plugin","owner":"openjfx","description":"Maven plugin to run JavaFX 11+ applications","archived":false,"fork":false,"pushed_at":"2023-08-15T17:45:18.000Z","size":173,"stargazers_count":380,"open_issues_count":79,"forks_count":62,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-03-28T10:06:25.076Z","etag":null,"topics":["javafx","javafx-11","javafx-maven-plugin","javafx-modules","maven-plugin","openjfx"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openjfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-02-28T22:30:17.000Z","updated_at":"2025-03-25T07:17:53.000Z","dependencies_parsed_at":"2024-01-15T11:11:02.833Z","dependency_job_id":"dd20701e-4dac-4d20-93a3-ffaf1fad5c7d","html_url":"https://github.com/openjfx/javafx-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openjfx%2Fjavafx-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openjfx%2Fjavafx-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openjfx%2Fjavafx-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openjfx%2Fjavafx-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openjfx","download_url":"https://codeload.github.com/openjfx/javafx-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javafx","javafx-11","javafx-maven-plugin","javafx-modules","maven-plugin","openjfx"],"created_at":"2024-08-04T00:00:49.157Z","updated_at":"2025-04-04T11:12:35.423Z","avatar_url":"https://github.com/openjfx.png","language":"Java","funding_links":[],"categories":["Community"],"sub_categories":["Tools"],"readme":"# Maven plugin for JavaFX\n\n[![Maven Central](https://img.shields.io/maven-central/v/org.openjfx/javafx-maven-plugin.svg?color=%234DC71F)](https://search.maven.org/#search|ga|1|org.openjfx.javafx-maven-plugin)\n[![Travis CI](https://api.travis-ci.com/openjfx/javafx-maven-plugin.svg?branch=master)](https://travis-ci.com/openjfx/javafx-maven-plugin)\n[![Apache License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\nMaven plugin to run JavaFX 11+ applications\n\n## Install\n\nThe plugin is available via Maven Central. \n\nIn case you want to build and install the latest snapshot, you can\nclone the project, set JDK 11 and run\n\n```\nmvn install\n``` \n\n## Usage\n\nCreate a new Maven project, use an existing one like [HelloFX](https://github.com/openjfx/samples/tree/master/CommandLine/Modular/Maven/hellofx), or use an [archetype](https://github.com/openjfx/javafx-maven-archetypes).\n\nThe project can be modular or non-modular.\n\nJavaFX dependencies are added as usual:\n\n```\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-controls\u003c/artifactId\u003e\n    \u003cversion\u003e12.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAdd the plugin:\n\n```\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.8\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cmainClass\u003ehellofx/org.openjfx.App\u003c/mainClass\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\nCompile the project:\n\n```\nmvn compile\n```\n\nThis step is optional and can be configured using the [maven-compiler-plugin](https://maven.apache.org/plugins/maven-compiler-plugin/).\n\nRun the project:\n\n```\nmvn javafx:run\n```\n\nFor modular projects, create and run a custom image:\n\n```\nmvn javafx:jlink\n\ntarget/image/bin/java -m hellofx/org.openjfx.App\n```\n\n### javafx:run options\n\nThe plugin includes by default: `--module-path`, `--add-modules` and `-classpath` options. \n\nOptionally, the configuration can be modified with:\n\n- `mainClass`: The main class, fully qualified name, with or without module name\n- `workingDirectory`: The current working directory\n- `skip`: Skip the execution. Values: false (default), true\n- `outputFile`: File to redirect the process output\n- `options`: A list of VM options passed to the executable.\n- `commandlineArgs`: Arguments separated by space for the executed program\n- `includePathExceptionsInClasspath`: When resolving the module-path, setting this value to true will include the \ndependencies that generate path exceptions in the classpath. By default, the value is false, and these dependencies \nwon't be included.\n- `runtimePathOption`: By default, the plugin will place *each* dependency either on modulepath or on classpath (based on certain factors).\nWhen `runtimePathOption` configuration is set, the plugin will place *all* the dependencies on either modulepath or classpath.\n\n    If set as `MODULEPATH`, a module descriptor is required. All dependencies need to be either modularized or contain an Automatic-Module-Name.\n\n    If set as `CLASSPATH`, a Launcher class ([like this one](https://github.com/openjfx/samples/blob/master/CommandLine/Non-modular/CLI/hellofx/src/hellofx/Launcher.java))\nis required to run a JavaFX application. Also, if a module-info descriptor is present, it will be ignored.\n\n    Values: MODULEPATH or CLASSPATH.\n\nThis plugin supports Maven toolchains using the \"jdk\" tool.\n\n### Example\n\nThe following configuration adds some VM options, and a command line argument:\n\n```\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.8\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cmainClass\u003eorg.openjfx.hellofx/org.openjfx.App\u003c/mainClass\u003e\n        \u003coptions\u003e\n            \u003coption\u003e-Dbar=${bar}\u003c/option\u003e\n            \u003coption\u003e--add-opens\u003c/option\u003e\n            \u003coption\u003ejava.base/java.lang=org.openjfx.hellofx\u003c/option\u003e\n        \u003c/options\u003e\n        \u003ccommandlineArgs\u003efoo\u003c/commandlineArgs\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\nWhen running maven with\n```\nmvn -Dbar=myBar javafx:run\n```\nit will be processed by the main method like:\n\n```java\npublic static void main(String[] args) {\n    if (args.length \u003e 0 \u0026\u0026 \"foo\".equals(args[0])) {\n        // do something\n    }\n    if (\"myBar\".equals(System.getProperty(\"bar\"))) {\n        // do something\n    }\n    launch();\n}\n```\n\nNote that the evaluation of `System.getProperty(\"bar\")` can happen in any other place in the code.\n\n**Note**\n\nIt is possible to use a local SDK instead of Maven Central. \nThis is helpful for developers trying to test a local build of OpenJFX. \nSince transitive dependencies are not resolved, \nall the required jars needs to be added as a separate dependency, like:\n\n```\n\u003cproperties\u003e\n    \u003csdk\u003e/path/to/javafx-sdk\u003c/sdk\u003e\n\u003c/properties\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n        \u003cartifactId\u003ejavafx.base\u003c/artifactId\u003e\n        \u003cversion\u003e1.0\u003c/version\u003e\n        \u003cscope\u003esystem\u003c/scope\u003e\n        \u003csystemPath\u003e${sdk}/lib/javafx.base.jar\u003c/systemPath\u003e\n    \u003c/dependency\u003e\n    ...\n\u003c/dependencies\u003e\n```\n\n### javafx:jlink options\n\nThe same command line options for `jlink` can be set:\n\n- `stripDebug`: Strips debug information out. Values: false (default) or true\n- `stripJavaDebugAttributes`: Strip Java debug attributes out (since Java 13), Values: false (default) or true\n- `compress`: Compression level of the resources being used. Values: 0 (default), 1, 2. \n- `noHeaderFiles`: Removes the `includes` directory in the resulting runtime image. Values: false (default) or true\n- `noManPages`: Removes the `man` directory in the resulting runtime image. Values: false (default) or true\n- `bindServices`: Adds the option to bind services. Values: false (default) or true\n- `ignoreSigningInformation`: Adds the option to ignore signing information. Values: false (default) or true\n- `jlinkVerbose`: Adds the verbose option. Values: false (default) or true\n- `launcher`: Adds a launcher script with the given name. \n    - If `options` are defined, these will be passed to the launcher script as vm options. \n    - If `commandLineArgs` are defined, these will be passed to the launcher script as command line arguments.\n- `jlinkImageName`: The name of the folder with the resulting runtime image\n- `jlinkZipName`: When set, creates a zip of the resulting runtime image\n- `jlinkExecutable`: The `jlink` executable. It can be a full path or the name of the executable, if it is in the PATH.\n- `jmodsPath`: When using a local JavaFX SDK, sets the path to the local JavaFX jmods\n\nFor instance, with the following configuration:\n\n```\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.openjfx\u003c/groupId\u003e\n    \u003cartifactId\u003ejavafx-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e0.0.8\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cstripDebug\u003etrue\u003c/stripDebug\u003e\n        \u003ccompress\u003e2\u003c/compress\u003e\n        \u003cnoHeaderFiles\u003etrue\u003c/noHeaderFiles\u003e\n        \u003cnoManPages\u003etrue\u003c/noManPages\u003e\n        \u003clauncher\u003ehellofx\u003c/launcher\u003e\n        \u003cjlinkImageName\u003ehello\u003c/jlinkImageName\u003e\n        \u003cjlinkZipName\u003ehellozip\u003c/jlinkZipName\u003e\n        \u003cmainClass\u003ehellofx/org.openjfx.MainApp\u003c/mainClass\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\nA custom image can be created and run as:\n\n```\nmvn clean javafx:jlink\n\ntarget/hello/bin/hellofx\n```\n\n## Issues and Contributions ##\n\nIssues can be reported to the [Issue tracker](https://github.com/openjfx/javafx-maven-plugin/issues/).\n\nContributions can be submitted via [Pull requests](https://github.com/openjfx/javafx-maven-plugin/pulls/), \nproviding you have signed the [Gluon Individual Contributor License Agreement (CLA)](https://docs.google.com/forms/d/16aoFTmzs8lZTfiyrEm8YgMqMYaGQl0J8wA0VJE2LCCY).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenjfx%2Fjavafx-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenjfx%2Fjavafx-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenjfx%2Fjavafx-maven-plugin/lists"}