{"id":16199431,"url":"https://github.com/dadrus/javahome-resolver-maven-plugin","last_synced_at":"2025-04-02T11:30:37.206Z","repository":{"id":34427301,"uuid":"38360332","full_name":"dadrus/javahome-resolver-maven-plugin","owner":"dadrus","description":"Performs the lookup of the path to the used jdk and exports it as maven property","archived":false,"fork":false,"pushed_at":"2017-08-16T06:55:54.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-16T21:35:28.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/dadrus.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}},"created_at":"2015-07-01T08:51:55.000Z","updated_at":"2021-02-02T14:11:10.000Z","dependencies_parsed_at":"2022-08-17T20:40:40.605Z","dependency_job_id":null,"html_url":"https://github.com/dadrus/javahome-resolver-maven-plugin","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/dadrus%2Fjavahome-resolver-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadrus%2Fjavahome-resolver-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadrus%2Fjavahome-resolver-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadrus%2Fjavahome-resolver-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadrus","download_url":"https://codeload.github.com/dadrus/javahome-resolver-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246806355,"owners_count":20837086,"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-10-10T09:25:24.298Z","updated_at":"2025-04-02T11:30:36.877Z","avatar_url":"https://github.com/dadrus.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# javahome-resolver-maven-plugin\n**Performs the lookup of the path to the used jdk and exports it as maven property**\n\nIf you have a need to develop and maintain a system and your maintenance and development branches diverge in used JDK, you could use [Maven Toolchains Plugin](https://maven.apache.org/plugins/maven-toolchains-plugin/).\nBut what if some of your tests require the path to the JDK used to build the system, e.g. to start an application server which can't be started with a newer\nJDK, then this plugin may be for you.\n\nIn my specific case I use [arquillian](http://arquillian.org) with JBoss. The corresponding arquillian container [configuration](https://docs.jboss.org/author/display/ARQ/JBoss+AS+7.1,+JBoss+EAP+6.0+-+Managed)\nexpects an optional `javaHome` variable provided, otherwise a system wide `JAVA_HOME` is used. Given the situation, that the development main stream uses java\n8 and JBoss EAP 6.4, but the maintenance must be performed using java 7 and JBoss EAP 6.0 (which does not support java 8), I was looking for a way not to be\nforced to switch between environment configurations if I just switch a branch. The idea was to use the aforementioned maven toolchains plugin. Unfortunately \nneither the toolchains plugin, nor the surefire, failsafe, or other toolchains aware plugins, I'm familiar with, do expose a variable pointing to a path for the\nchoosen JDK. Thus this plugin was born.\n\n## Plugin Behaviour\n- exports a `javaHome` property with the path to choosen JDK if maven toolchains plugin is used, otherwise\n- exports a `javaHome` property which has the same value as the configured `JAVA_HOME` environment variable.\n\n## Limitations\nThe plugin does not integrate with eclipse properly. I was unable to find out how to force eclipse to refilter affected ressources.\n\n## Usage\nYou should add \"javahome-resolver-maven-plugin\" to your `\u003cbuild\u003e` configuration. The default lifecycle phase is `validate`. The plugin has a single goal - `resolve`.\nHere is an example:\n\n```xml\n\u003cbuild\u003e\n\t\u003cplugins\u003e\n\t\t\u003cplugin\u003e\n\t\t\t\u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003emaven-toolchains-plugin\u003c/artifactId\u003e\n\t\t\t\u003cexecutions\u003e\n\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\u003cphase\u003evalidate\u003c/phase\u003e\n\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\u003cgoal\u003etoolchain\u003c/goal\u003e\n\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\u003c/execution\u003e\n\t\t\t\u003c/executions\u003e\n\t\t\t\u003cconfiguration\u003e\n\t\t\t\t\u003ctoolchains\u003e\n\t\t\t\t\t\u003cjdk\u003e\n\t\t\t\t\t\t\u003cversion\u003e${maven.compiler.target}\u003c/version\u003e\n\t\t\t\t\t\u003c/jdk\u003e\n\t\t\t\t\u003c/toolchains\u003e\n\t\t\t\u003c/configuration\u003e\n\t\t\u003c/plugin\u003e\n\t\t\u003cplugin\u003e\n\t\t\t\u003cgroupId\u003eeu.drus.maven.plugins\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ejavahome-resolver-maven-plugin\u003c/artifactId\u003e\n\t\t\t\u003cexecutions\u003e\n\t\t\t\t\u003cexecution\u003e\n\t\t\t\t\t\u003cgoals\u003e\n\t\t\t\t\t\t\u003cgoal\u003eresolve\u003c/goal\u003e\n\t\t\t\t\t\u003c/goals\u003e\n\t\t\t\t\u003c/execution\u003e\n\t\t\t\u003c/executions\u003e\n\t\t\u003c/plugin\u003e\n\t\u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadrus%2Fjavahome-resolver-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadrus%2Fjavahome-resolver-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadrus%2Fjavahome-resolver-maven-plugin/lists"}