{"id":20227639,"url":"https://github.com/panga/hammock-jpms","last_synced_at":"2025-04-10T17:23:36.112Z","repository":{"id":70366759,"uuid":"136390386","full_name":"panga/hammock-jpms","owner":"panga","description":" Hammock MicroProfile (CDI + JAXRS + JSON) HelloWorld using Java Module System (JPMS)","archived":false,"fork":false,"pushed_at":"2018-07-26T19:47:30.000Z","size":27,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:03:54.832Z","etag":null,"topics":["hammock","java","jdk10","jpms"],"latest_commit_sha":null,"homepage":"https://medium.com/criciumadev/first-microprofile-io-application-using-java-module-system-33b83ae939c9","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/panga.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":"2018-06-06T21:56:55.000Z","updated_at":"2019-08-29T11:19:17.000Z","dependencies_parsed_at":"2023-02-22T20:15:45.004Z","dependency_job_id":null,"html_url":"https://github.com/panga/hammock-jpms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panga%2Fhammock-jpms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panga%2Fhammock-jpms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panga%2Fhammock-jpms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panga%2Fhammock-jpms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panga","download_url":"https://codeload.github.com/panga/hammock-jpms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261953,"owners_count":21074227,"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":["hammock","java","jdk10","jpms"],"created_at":"2024-11-14T07:25:46.285Z","updated_at":"2025-04-10T17:23:36.100Z","avatar_url":"https://github.com/panga.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hammock JPMS\n\n[Hammock MicroProfile](https://github.com/hammock-project/hammock) (CDI + JAX-RS + JSON) HelloWorld using Java Module System (JPMS).\n\nThe stack uses Weld 3 for CDI, RestEasy 3.5 for JAX-RS and Johnzon 1.1 for JSON\n\nThe total size of this example application is around `12mb` and the full Docker image is only `55mb`!\n\n_Note: Tested with JDK 11-ea+23_\n\n## How To\n\n### Package and generate `target/modules` folder (weld profile)\n\n`mvn clean package`\n\n### Package and generate `docker image` (docker + weld profiles)\n\n`mvn clean package -Pweld,docker`\n\n### Package using with OpenWebBeans 2 for CDI (owb profile)\n\n`mvn clean package -Powb`\n\n### Run using the default JRE\n\n`java --module-path target/modules --module hammock.jpms`\n\n### Run using a minimal JRE (35mb)\n\n1. Run jlink to create minimal JRE\n\n```bash\njlink \\\n\t--add-modules java.logging,java.xml,java.naming,java.management,jdk.unsupported \\\n\t--verbose \\\n\t--strip-debug \\\n\t--compress 2 \\\n\t--no-header-files \\\n\t--no-man-pages \\\n\t--output target/jlink-image\n```\n\n2. Run minimal JRE with patch module for `java.beans`:\n\n```bash\ntarget/jlink-image/bin/java \\\n    --patch-module java.base=target/patch/java.beans \\\n    --add-exports java.base/java.beans=johnzon.mapper \\\n    --add-exports java.base/java.beans=org.apache.logging.log4j.core \\\n    --module-path target/modules \\\n    --module hammock.jpms\n```\n\n_Note: https://github.com/panga/lite-beans was used to patch `java.beans` implementation required by some 3rd party dependencies and remove the requirement of adding `java.desktop` module into the minimal JRE._\n\n### Run using the Docker image\n\n`docker run --rm -it -p 8080:8080 hammock-jpms`\n\n### Test the application\n\n`curl http://localhost:8080/hello`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanga%2Fhammock-jpms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanga%2Fhammock-jpms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanga%2Fhammock-jpms/lists"}