{"id":22105154,"url":"https://github.com/ghackenberg/jigsaw-maven-plugin","last_synced_at":"2025-10-05T23:01:54.712Z","repository":{"id":39600474,"uuid":"408457396","full_name":"ghackenberg/jigsaw-maven-plugin","owner":"ghackenberg","description":"Maven Plugin for linking and packaging Java applications that include unnamed module dependencies (using jdeps,  jlink, and jpackage).","archived":false,"fork":false,"pushed_at":"2024-11-22T15:12:08.000Z","size":73,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-22T16:21:17.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghackenberg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T13:37:35.000Z","updated_at":"2024-11-22T15:12:11.000Z","dependencies_parsed_at":"2024-03-12T09:52:39.939Z","dependency_job_id":null,"html_url":"https://github.com/ghackenberg/jigsaw-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/ghackenberg%2Fjigsaw-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghackenberg%2Fjigsaw-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghackenberg%2Fjigsaw-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghackenberg%2Fjigsaw-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghackenberg","download_url":"https://codeload.github.com/ghackenberg/jigsaw-maven-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227502854,"owners_count":17781701,"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":[],"created_at":"2024-12-01T06:38:58.252Z","updated_at":"2025-10-05T23:01:54.638Z","avatar_url":"https://github.com/ghackenberg.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jigsaw-maven-plugin\n\nLinking and packaging Java applications with old-style **unnamed modules** is cumbersome.\nThe **jigsaw-maven-plugin** tries to simplify this task with three build goals: **patch**, **link**, and **package** (see below).\n\n## Documents\n\nRead the folowing documents to learn more about the project:\n\n* [License](./LICENSE.md)\n* [Changelog](./CHANGELOG.md)\n* [Contributing](./CONTRIBUTING.md)\n\nAlso, do not hesitate to contact the project owner 😉 (ghackenberg@gmail.com).\n\n## Preparations\n\nThe **jigsaw-maven-plugin** requires two preparational steps:\n\n1. Output archive\n2. Copy dependencies\n\nIn the following, each step is described in more detail.\n\n### Step 1: Output archive\n\nOutput archive to **modules** folder:\n\n```xml\n\u003cplugin\u003e\n    \u003cartifactId\u003emaven-jar-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e3.3.0\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003coutputDirectory\u003e${project.build.directory}/modules\u003c/outputDirectory\u003e\n        \u003c!-- output to ${project.build.directory}/modules --\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n### Step 2: Copy dependencies\n\nCopy dependencies to **modules** folder:\n\n```xml\n\u003cplugin\u003e\n    \u003cartifactId\u003emaven-dependency-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e3.4.0\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cphase\u003epackage\u003c/phase\u003e\n            \u003c!-- execute during package phase --\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003ecopy-dependencies\u003c/goal\u003e\n                \u003c!-- execute copy-dependencies goal --\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003coutputDirectory\u003e${project.build.directory}/modules\u003c/outputDirectory\u003e\n                \u003c!-- output to ${project.build.directory}/modules --\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n## Goals\n\nThe **jigsaw-maven-plugin** provides three build goals:\n\n* `patch`\n* `link`\n* `package`\n\nIn the following, each goal is described in more detail.\n\n### Goal `patch` (using [jdeps](https://docs.oracle.com/en/java/javase/16/docs/specs/man/jdeps.html) and [javac](https://docs.oracle.com/en/java/javase/16/docs/specs/man/javac.html))\n\nConvert **unnamed modules** (i.e. Java archives missing a **module-info.class** file) to named modules. This step is necessary for **jlink** and **jpackage** to work properly (see following sections). Unfortunatelly, both tools cannot process unnamed modules, which are common in many Java projects until today.\n\n#### Configuration details\n\nThe **patch mojo** can be configured as follows:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eio.github.ghackenberg\u003c/groupId\u003e\n    \u003cartifactId\u003ejigsaw-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.3\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003ejigsaw-patch\u003c/id\u003e\n            \u003cphase\u003epackage\u003c/phase\u003e\n            \u003c!-- execute during package phase --\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003epatch\u003c/goal\u003e\n                \u003c!-- execute patch goal --\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cmodulePath\u003e${project.build.directory}/modules\u003c/modulePath\u003e\n                \u003c!-- type = string, default = ${project.build.directory}/modules --\u003e\n                \u003cmultiRelease\u003e${maven.compiler.target}\u003c/multiRelease\u003e\n                \u003c!-- type = string --\u003e\n                \u003cignoreMissingDeps\u003etrue\u003c/ignoreMissingDeps\u003e\n                \u003c!-- type = boolean --\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n#### Implementation details\n\nThe **patch mojo** searched for unnamed modules (i.e. Java archives missing a **module-info.class** file) in the modules path. For each unnamed module the mojo generates a **module-info.java** file using the **jdeps** tool. Then, the mojo compiles the module descriptors and adds the to the original Java archives. Consequently, unnamed modules are turned into named modules.\n\n### Goal `link` (using [jlink](https://docs.oracle.com/en/java/javase/16/docs/specs/man/jlink.html))\n\nLink **named modules** to executable images. Executable images only include the necessary Java modules. Consequently, smaller executable bundles can be achieved. The executable images can be packaged later using **jpackage** (see next section).\n\n#### Configuration details\n\nThe **link mojo** can be configured as follows:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eio.github.ghackenberg\u003c/groupId\u003e\n    \u003cartifactId\u003ejigsaw-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.3\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003ejigsaw-link\u003c/id\u003e\n            \u003cphase\u003epackage\u003c/phase\u003e\n            \u003c!-- execute during package phase --\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003elink\u003c/goal\u003e\n                \u003c!-- execute link goal --\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cmodulePath\u003e${project.build.directory}/modules\u003c/modulePath\u003e\n                \u003c!-- type = string, default = ${project.build.directory}/modules --\u003e\n                \u003cmodule\u003e${project.artifactId}\u003c/module\u003e\n                \u003c!-- type = string, default = ${project.artifactId} --\u003e\n                \u003cignoreSigningInfo\u003etrue\u003c/ignoreSigningInfo\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003coutput\u003e${project.build.directory}/image\u003c/output\u003e\n                \u003c!-- type = file, default = ${project.build.directory}/image --\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n#### Implementation details\n\nThe **link mojo** uses the **jlink** tool internally. The mojo simply wraps the command line call **jlink**.\n\n### Goal `package` (using [jpackage](https://docs.oracle.com/en/java/javase/16/docs/specs/man/jpackage.html))\n\nPackage **executable image** to OS-specific installers. OS-specific installers can be used to install the Java application on any target machine running a compatible OS installation. Note that the installers also update previously installed versions of the same Java application. The installers can be built from the executable images generated with **jlink** (see previous section).\n\n#### Configuration details\n\nThe **package mojo** can be configured as follows:\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003eio.github.ghackenberg\u003c/groupId\u003e\n    \u003cartifactId\u003ejigsaw-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e1.1.3\u003c/version\u003e\n    \u003cexecutions\u003e\n        \u003cexecution\u003e\n            \u003cid\u003ejigsaw-package\u003c/id\u003e\n            \u003cphase\u003epackage\u003c/phase\u003e\n            \u003c!-- execute during package phase --\u003e\n            \u003cgoals\u003e\n                \u003cgoal\u003epackage\u003c/goal\u003e\n                \u003c!-- execute package goal --\u003e\n            \u003c/goals\u003e\n            \u003cconfiguration\u003e\n                \u003cruntimeImage\u003e${project.build.directory}/image\u003c/runtimeImage\u003e\n                \u003c!-- type = file, default = ${project.build.directory}/image --\u003e\n                \u003cmodulePath\u003e${project.build.directory}/modules\u003c/modulePath\u003e\n                \u003c!-- type = string, default = ${project.build.directory}/modules --\u003e\n                \u003cmodule\u003e${project.artifactId}\u003c/module\u003e\n                \u003c!-- type = string, default = ${project.artifactId} --\u003e\n                \u003cmainClass\u003epath.to.Main\u003c/mainClass\u003e\n                \u003c!-- type = string, required = true --\u003e\n                \u003cignoreSigningInfo\u003etrue\u003c/ignoreSigningInfo\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003cjavaOptions\u003e-Xmx64m\u003c/javaOptions\u003e\n                \u003c!-- type = string --\u003e\n                \u003cname\u003e${project.name}\u003c/name\u003e\n                \u003c!-- type = string, default = ${project.name} --\u003e\n                \u003cappVersion\u003e${project.version}\u003c/appVersion\u003e\n                \u003c!-- type = string, default = ${project.version} --\u003e\n                \u003cdescription\u003e${project.description}\u003c/description\u003e\n                \u003c!-- type = file --\u003e\n                \u003cvendor\u003e${project.organization.name}\u003c/vendor\u003e\n                \u003c!-- type = string, default = ${project.organization.name} --\u003e\n                \u003ccopyright\u003e${project.organization.name}\u003c/copyright\u003e\n                \u003c!-- type = string, default = ${project.organization.name} --\u003e\n                \u003clicenseFile\u003epath/to/license.rtf\u003c/licenseFile\u003e\n                \u003c!-- type = file --\u003e\n                \u003cicon\u003epath/to/icon.ico\u003c/icon\u003e\n                \u003c!-- type = string --\u003e\n                \u003cfileAssociations\u003epath/to/associations.properties\u003c/fileAssociations\u003e\n                \u003c!-- type = file --\u003e\n                \u003cwinUpgradeUuid\u003e...\u003c/winUpgradeUuid\u003e\n                \u003c!-- type = string --\u003e\n                \u003cwinPerUserInstall\u003etrue\u003c/winPerUserInstall\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003cwinDirChooser\u003etrue\u003c/winDirChooser\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003cwinShortcut\u003etrue\u003c/winShortcut\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003cwinMenu\u003etrue\u003c/winMenu\u003e\n                \u003c!-- type = boolean --\u003e\n                \u003cwinMenuGroup\u003e${project.organization.name}\u003c/winMenuGroup\u003e\n                \u003c!-- type = string --\u003e\n                \u003cdest\u003e${project.build.directory}\u003c/dest\u003e\n                \u003c!-- type = file, default = ${project.build.directory} --\u003e\n            \u003c/configuration\u003e\n        \u003c/execution\u003e\n    \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n#### Implementation details\n\nThe **package mojo** uses the **jpackage** tool internally. The mojo simply wraps the command line call **jpackage**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghackenberg%2Fjigsaw-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghackenberg%2Fjigsaw-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghackenberg%2Fjigsaw-maven-plugin/lists"}