{"id":31706420,"url":"https://github.com/softwaretechnik-berlin/jlauncher","last_synced_at":"2025-10-08T23:13:33.442Z","repository":{"id":49116999,"uuid":"119373961","full_name":"softwaretechnik-berlin/jlauncher","owner":"softwaretechnik-berlin","description":"Fat jars without the fat","archived":false,"fork":false,"pushed_at":"2023-01-03T15:38:18.000Z","size":57,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-20T11:14:37.263Z","etag":null,"topics":["bundling","cli","jvm","launch"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/softwaretechnik-berlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-29T11:28:53.000Z","updated_at":"2022-02-08T22:44:17.000Z","dependencies_parsed_at":"2023-02-01T07:16:36.052Z","dependency_job_id":null,"html_url":"https://github.com/softwaretechnik-berlin/jlauncher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/softwaretechnik-berlin/jlauncher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaretechnik-berlin%2Fjlauncher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaretechnik-berlin%2Fjlauncher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaretechnik-berlin%2Fjlauncher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaretechnik-berlin%2Fjlauncher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwaretechnik-berlin","download_url":"https://codeload.github.com/softwaretechnik-berlin/jlauncher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwaretechnik-berlin%2Fjlauncher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278015590,"owners_count":25915462,"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","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bundling","cli","jvm","launch"],"created_at":"2025-10-08T23:13:31.043Z","updated_at":"2025-10-08T23:13:33.431Z","avatar_url":"https://github.com/softwaretechnik-berlin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\njlauncher is a utility that makes it easy to run jvm based programs without having to assemble them\ninto \"fat jars\". jlauncher fetches jar files and their dependencies from maven style repos and launches a main class.\n\nThe input is a special manifest that locks down all dependency versions, so that the launch is repeatable.\n\n# Installing jlauncher\n\nCurrently jlauncher is implemented in ruby and distributed as a ruby gem. The installation is straightforward:\n\n```bash\ngem install jlauncher\n```\n\n# Launching a Local Manifest File\n\nHere is an example of a manifest file to launch a [helloworld example](maven-example/src/main/java/org/programmiersportgruppe/jtester/App.java)\ndirectly from maven central:\n\n```json\n{\n  \"mainClass\": \"org.programmiersportgruppe.jtester.App\",\n  \"dependencies\": [\n    {\n      \"groupId\": \"com.beust\",\n      \"artifactId\": \"jcommander\",\n      \"version\": \"1.72\"\n    },\n    {\n      \"groupId\": \"org.programmiersportgruppe\",\n      \"artifactId\": \"j-maven-tester\",\n      \"version\": \"0.2.0\"\n    }\n  ]\n}\n```\n\nThe `jlauncher` command line tool can now be used to launch the manifest. The parameters after the manifest are\npassed into the main class.\n\n```bash\njlauncher run manifest.json --name Tom\n```\n\nWhile manifest can be created manually,\nthis process can be automated using the maven / sbt plugin. Also,\nthe convention is to package a manifest as `j-manifest.json` into an \n\"executable\" jar.\n\n# Launching from a Local Jar-File\n\nA jar file containing a j-manifest can then be launched like this:\n\n```bash\njlauncher run target/j-maven-tester-0.2.0.jar --name Jerry\n```\n\n# Launching from Maven Coordinates\n\nIf the jar is deployed to maven central we can also launch it using its maven coordinates:\n\n```bash\njlauncher run org.programmiersportgruppe:j-maven-tester:0.2.0 --name World\n```\n\n# Installing a Wrapper Script\n\njlauncher also supports the installation of a wrapper script,\nin the jlauncher `bin`-directory, so that a utiltiy packaged\nwith jlauncher manifest can be started with a simple script name.\n\nIf we take our previous hello world example, we can install it \nlike so:\n\n```bash\njlauncher install org.programmiersportgruppe:j-maven-tester:0.2.0\n```\n \nWith the jlauncher `bin`-directory on the path we can now start\nhello world like this:\n\n```bash\nhello-world --name Donald\n```\n\n# Creating an executable jar with Maven\n\nTo get started you need to add the plugin to your maven build and specify the main class:\n\n```xml\n \u003cbuild\u003e\n        \u003cplugins\u003e\n\n            \u003cplugin\u003e\n                \u003cgroupId\u003eorg.buildobjects\u003c/groupId\u003e\n                \u003cartifactId\u003ej-maven-plugin\u003c/artifactId\u003e\n                \u003cversion\u003e0.2.0\u003c/version\u003e\n                \u003cexecutions\u003e\n                    \u003cexecution\u003e\n                        \u003cphase\u003egenerate-resources\u003c/phase\u003e\n                        \u003cgoals\u003e\n                            \u003cgoal\u003ej\u003c/goal\u003e\n                        \u003c/goals\u003e\n                    \u003c/execution\u003e\n                \u003c/executions\u003e\n                \u003cconfiguration\u003e\n                    \u003cmainClass\u003eorg.programmiersportgruppe.App\u003c/mainClass\u003e\n                    \u003cexecutableName\u003ehello-world\u003c/executableName\u003e\n                \u003c/configuration\u003e\n            \u003c/plugin\u003e\n        \u003c/plugins\u003e\n    \u003c/build\u003e\n```\n\n# Creating an Executable Jar with SBT\n\nInclude the plugin into your project/plugins.sbt\n\n```scala\naddSbtPlugin(\"org.programmiersportgruppe.sbt\" % \"jpackager\" % \"0.2\")\n```\n\nThen add the following to your main module:\n\n```scala\nmainClass := Some(\"org.programmiersportgruppe.App\")\n\nresourceGenerators in Compile += generateManifest\n```\n\n# Creating an Executable Jar with mill\n\nMill currently doesn't have a plugin concept, so here we provide a snippet to generate a manifest (and package it\ninto the jar):\n\n```scala\nobject mymodule extends SbtModule {\n\n  // … Normal module definition stuff left out for clarity\n\n  // Include the manifest in the classpath so that it gets packaged:\n  override def localClasspath = T {super.localClasspath() ++ jManifest()}\n\n  // The task to create the manifest:\n  def jManifest: Target[Seq[PathRef]] = T {\n    os.makeDir.all(T.dest)\n    val (_, resolution) = Lib.resolveDependenciesMetadata(\n      repositories,\n      resolveCoursierDependency().apply(_),\n      transitiveIvyDeps(),\n      Some(mapDependencies())\n    )\n\n    val jsonManifest = ujson.write(\n      ujson.Obj(\n        \"mainClass\" -\u003e ujson.Str(mainClass().get),\n        \"executableName\" -\u003e ujson.Str(\"hello-world\"),\n        \"dependencies\" -\u003e\n          resolution.dependencies.map(x =\u003e\n            ujson.Obj(\n              \"groupId\" -\u003e ujson.Str(x.module.organization.value),\n              \"artifactId\" -\u003e ujson.Str(x.module.name.value),\n              \"version\" -\u003e ujson.Str(x.version)\n            )\n        )), indent = 4)\n\n    os.write(T.dest / \"j-manifest.json\", jsonManifest)\n\n    Seq(PathRef(T.dest))\n  }\n}\n```\n\n## Backlog\n\n- [x] Fix typo in SBT key.\n- [ ] Make repositories overridable/ allow to define bootstrap,\n      repository, perhaps in a global config.\n- [ ] Add field for repositories in `manifest`, so that\n      artifacts can be pulled in from arbitrary repos.\n- [ ] Allow to specify vm version in the manifest.\n\n  It would be nice to allow to specify version ranges, e.g. \u003e= 9\n\n  The launcher should be able to pick the right jvm if it can find\n  it following platform conventions, e.g. doing a `/usr/libexec/java_home -X` on macOS.\n\n- [ ] Allow to specify vm options in the manifest.\n- [ ] Make vm options overridable on the command line.\n- [X] Have a way to add aliases/ wrapper scripts so that we can create an alias for a tool.\n      =\u003e We can now install.\n- [ ] Reimplement jlauncher in go, so that we can have a small statically linked executable that is\n      more suitable for use in a docker container.\n- [ ] Add progress bar for fetching deps\n- [ ] Make verbose mode beautiful, alignment, colours\n- [ ] Add optional size to dependencies in manifest, so that we have more accurate progress info.\n- [ ] Support \"LATEST\" version when using maven coordinates (this should also work offline)\n- [ ] Bash completion (local or remote, caching) for maven coordinates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaretechnik-berlin%2Fjlauncher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwaretechnik-berlin%2Fjlauncher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwaretechnik-berlin%2Fjlauncher/lists"}