{"id":24414832,"url":"https://github.com/andifalk/custom-spring-boot-launch-script","last_synced_at":"2026-04-13T13:31:09.363Z","repository":{"id":83441786,"uuid":"249953813","full_name":"andifalk/custom-spring-boot-launch-script","owner":"andifalk","description":"Demo for packaging a spring boot executable using a custom embedded launch script","archived":false,"fork":false,"pushed_at":"2020-03-25T10:59:04.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-30T22:46:36.170Z","etag":null,"topics":["customization","executable-jar","gradle","java","launch-script","maven","spring-boot"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andifalk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-25T10:54:38.000Z","updated_at":"2020-03-25T11:16:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"16dd3f51-b1e7-4b05-9e32-ad34c2acc28d","html_url":"https://github.com/andifalk/custom-spring-boot-launch-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andifalk/custom-spring-boot-launch-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andifalk%2Fcustom-spring-boot-launch-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andifalk%2Fcustom-spring-boot-launch-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andifalk%2Fcustom-spring-boot-launch-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andifalk%2Fcustom-spring-boot-launch-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andifalk","download_url":"https://codeload.github.com/andifalk/custom-spring-boot-launch-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andifalk%2Fcustom-spring-boot-launch-script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31754750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T13:27:56.013Z","status":"ssl_error","status_checked_at":"2026-04-13T13:21:23.512Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["customization","executable-jar","gradle","java","launch-script","maven","spring-boot"],"created_at":"2025-01-20T07:19:36.536Z","updated_at":"2026-04-13T13:31:09.357Z","avatar_url":"https://github.com/andifalk.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Boot Launch Demo\n\nIn addition to running Spring Boot applications by using java -jar, it is also possible to make fully executable applications for Unix systems. \nA fully executable jar can be executed like any other executable binary or it can be registered with init.d or systemd. \n\nDetails on this are described in the [Spring Boot reference docs](https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment-install).\n\n## Using Customized Launch Script\n\nTo achieve this the Spring Boot Maven or Gradle plugins repackage the jar file and add an embedded shell script to the jar.\nThis default shell script is provided by Spring Boot and should run on most Unix systems without any issues.\n\nBut sometimes the script does not work on your operating system for any reason \n(i.e. using a legacy version or the shell is not compatible with the default shell script)\n\nThis project shows how to use a customized launch script to create an executable jar. The _custom-launch-script.sh_ used here \njust adds an additional line ```echoRed \"My custom script is running!!!!\"``` to the script to show that the executable really\nuses the custom one instead of the default script.\n\nThe required steps are shown for \n\n* Maven based Spring Boot projects\n* Gradle based Spring Boot projects\n\n## Maven Build\n\nTo use the custom script you need to add this snippet to your maven pom to the spring boot plugin configuration section.\n\n```\n\u003cplugin\u003e\n    \u003cgroupId\u003eorg.springframework.boot\u003c/groupId\u003e\n    \u003cartifactId\u003espring-boot-maven-plugin\u003c/artifactId\u003e\n    \u003cconfiguration\u003e\n        \u003cexecutable\u003etrue\u003c/executable\u003e\n        \u003cembeddedLaunchScript\u003ecustom-launch-script.sh\u003c/embeddedLaunchScript\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\nNow perform a ```./mvnw clean package``` and after this execute the app:\n\n```shell script\n./target/boot-launch-demo-1.0.jar\n```\n\n## Gradle Build\n\nTo use the custom script you need to add this snippet to your _build.gradle_ file.\n\n```\nbootJar {\n    launchScript {\n        script = file(\"$projectDir/custom-launch-script.sh\")\n    }\n}\n```\n\nNow perform a ```./gradlew clean build``` and after this execute the app:\n\n```shell script\n./build/libs/boot-launch-demo-1.0.jar\n``` \n\n### Reference Documentation\nFor further reference, please consider the following sections:\n\n* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)\n* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.2.5.RELEASE/maven-plugin/)\n* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/html/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandifalk%2Fcustom-spring-boot-launch-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandifalk%2Fcustom-spring-boot-launch-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandifalk%2Fcustom-spring-boot-launch-script/lists"}