{"id":20019426,"url":"https://github.com/tambapps/groovexec","last_synced_at":"2026-06-05T13:31:26.574Z","repository":{"id":130832114,"uuid":"516792153","full_name":"tambapps/groovexec","owner":"tambapps","description":"Script to execute Groovy JARs without Groovy SDK in them","archived":false,"fork":false,"pushed_at":"2022-12-11T20:07:13.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T03:27:29.004Z","etag":null,"topics":["groovy","jar"],"latest_commit_sha":null,"homepage":"","language":"Groovy","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/tambapps.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-22T15:02:50.000Z","updated_at":"2022-07-23T04:19:10.000Z","dependencies_parsed_at":"2023-07-18T07:31:54.710Z","dependency_job_id":null,"html_url":"https://github.com/tambapps/groovexec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tambapps/groovexec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fgroovexec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fgroovexec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fgroovexec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fgroovexec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tambapps","download_url":"https://codeload.github.com/tambapps/groovexec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambapps%2Fgroovexec/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33944671,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"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":["groovy","jar"],"created_at":"2024-11-13T08:27:33.938Z","updated_at":"2026-06-05T13:31:26.553Z","avatar_url":"https://github.com/tambapps.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# groovexec: Execute JARs without Groovy SDK in them\n\n## Why groovexec\nGroovy can be used for scripting, but sometimes you need more than one class, and then your script turns into a \nproject. To execute a Groovy project (without an IDE), you would have to compile it. You could compile\nthe jar, including all the Groovy dependencies (`groovy-all` or specific dependencies like `groovy-json`) and then launch `java -jar my-groovy-project.jar` but\nthese jar can be quite heavy, as they include the whole Groovy SDK (at least the core of groovy).\n\nIf you installed Groovy on your computer, you already have the Groovy SDK. So why bother including it in your project's jar, making it heavier?\nJust build a jar containing only your compiled source code (and your other non-Groovy dependencies if any) and then execute it\nusing your installed Groovy SDK.\n\ngroovexec helps you execute such jars, relying on the Groovy SDK installed in your computer.\n\n\n## How to use\nHere is the usage of the script\n```text\nusage: groovexec [options] /path/to/jar [jar arguments]\n -D,--define \u003carg\u003e       (Optional) Define a system property (can be used\n                         many times)\n -m,--main-class \u003carg\u003e   (Optional) The main class to use. Will try to\n                         guess it using the main attribute 'Main-Class'\n                         from the jar's manifest if not provided\n```\n\nIf you are on Linux, you can install it with the `install.sh` script. It will put the script under the `/bin`\ndirectory of you groovy installation.\n\n### Examples\n\nWill try to find a main class in the jar\n```shell\ngroovexec jar-without-groovy-sdk.jar --my-project-arg 123\n```\n\nOr, if you want to explicitly specify the main class\n```shell\n# Specifying the main class and some java system properties\ngroovexec -m my.groovy.project.Main jar-without-groovy-sdk.jar --my-project-arg 123\n```\nYou can also define some Java System properties\n```shell\n# Specifying the main class and some java system properties\ngroovexec -D propert1=value1 -D property2=value2 jar-without-groovy-sdk.jar --my-project-arg 123\n```\n\nNote that if you don't want to install the groovexec, you could just execute the script with `groovy`.\n\nUse\n```shell\ngroovy groovexec.groovy args...\n```\n\nInstead of\n```shell\ngroovexec args...\n```\n\n## Excluding Groovy SDK from your JARs\nTo make your JAR smaller, you would have to exclude Groovy SDK when building it. \n\n### In Gradle projects\nUse the `compileOnly` for all your Groovy dependencies (actually I haven't tested this as I am a Maven guy, so if it doesn't work please, notify me)\n\nE.g.\n\n```groovy\ncompileOnly group: 'org.apache.groovy', name: 'groovy-all', version: '4.0.3', ext: 'pom'\ncompileOnly group: 'org.apache.groovy', name: 'groovy-cli-commons', version: '4.0.3'\n```\n\n### In Maven projects\n\nAdd the `provided` scope to all your Groovy dependencies\n\nE.g.\n```xml\n\u003cdependencies\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.groovy\u003c/groupId\u003e\n    \u003cartifactId\u003egroovy-all\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.3\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n  \u003c/dependency\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003eorg.apache.groovy\u003c/groupId\u003e\n    \u003cartifactId\u003egroovy-cli-commons\u003c/artifactId\u003e\n    \u003cversion\u003e4.0.3\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n  \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambapps%2Fgroovexec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftambapps%2Fgroovexec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambapps%2Fgroovexec/lists"}