{"id":25631795,"url":"https://github.com/esensar/neovim-java-plugin-host","last_synced_at":"2025-09-20T08:46:15.018Z","repository":{"id":114551652,"uuid":"496959974","full_name":"esensar/neovim-java-plugin-host","owner":"esensar","description":"Neovim Java plugin manager and host - Moved to https://codeberg.org/neovim-java/neovim-java-plugin-host","archived":false,"fork":false,"pushed_at":"2023-05-21T20:51:34.000Z","size":64,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-10T08:36:10.635Z","etag":null,"topics":["api","java","neovim","neovim-java-plugin","neovim-plugin","plugin","rpc"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/esensar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-05-27T10:48:37.000Z","updated_at":"2024-07-01T06:09:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac1e2da5-8674-4d96-8d9b-7fdbf7fbe210","html_url":"https://github.com/esensar/neovim-java-plugin-host","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/esensar/neovim-java-plugin-host","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esensar%2Fneovim-java-plugin-host","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esensar%2Fneovim-java-plugin-host/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esensar%2Fneovim-java-plugin-host/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esensar%2Fneovim-java-plugin-host/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esensar","download_url":"https://codeload.github.com/esensar/neovim-java-plugin-host/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esensar%2Fneovim-java-plugin-host/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276070208,"owners_count":25580123,"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-09-20T02:00:10.207Z","response_time":63,"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":["api","java","neovim","neovim-java-plugin","neovim-plugin","plugin","rpc"],"created_at":"2025-02-22T20:31:30.790Z","updated_at":"2025-09-20T08:46:14.985Z","avatar_url":"https://github.com/esensar.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java plugin host\n\nPlugin enabling configuration of Neovim using Java and running JAR plugins.\n\n**WORK IN PROGRESS - EXPERIMENTAL, USE AT YOUR OWN RISK!**\n\n\n## Requirements\n\n- [NeoVim](https://neovim.io) version 0.7.0+\n\n## Installation\n\nInstall using favourite plugin manager.\n\ne.g. Using [Packer.nvim](https://github.com/wbthomason/packer.nvim)\n\n```\nuse { 'https://codeberg.org/neovim-java/neovim-java-plugin-host' }\n```\n\n## Usage\n\nCall setup function and define plugins in it. The following shows default options:\n```lua\nrequire(\"java_plugin_host\").setup {\n  rplugins = {\n    load_hosted = true, -- set to false to prevent loading hosted plugins from rplugin/hosted-jar\n    load_standalone = false, -- set to true to automatically load and start all plugins from rplugin/jar as standalone plugins\n    load_class = false, -- set to true to also load .class files from rplugin/java - useful for quick plugins\n    compile_java = false, -- set to true to compile .java files from rplugin/java - set load_class to true to also load them\n  },\n  common_host = {\n    enabled = true, -- set to false to disable common host and hosted plugins\n    -- Change to override default common plugins host\n    -- This is an executable jar which will be started and host all other plugins\n    -- Should be based on com.ensarsarajcic.neovim.java:plugin-host to work properly\n    -- Or it should be able to properly process annotations used for plugins\n    -- This field can also be defined as string, e.g. \"com.ensarsarajcic.neovim.java:plugins-common-host:0.4.6\"\n    name = {\n      group_id = \"com.ensarsarajcic.neovim.java\",\n      artifact_id = \"plugins-common-host\",\n      version = \"0.4.6\"\n    },\n    -- When changing common_host.name, this should also be changed to the main class\n    -- of the other artifact used as common host\n    main_class_name = \"com.ensarsarajcic.neovim.java.commonhost.CommonPluginHost\",\n    -- List hosted plugins here - artifacts from system default maven repositories\n    hosted_plugins = {\n    -- Example:\n    -- {\n    --   group_id = \"com.ensarsarajcic.neovim.java\",\n    --   artifact_id = \"rplugin-hosted-example\",\n    --   version = \"0.4.2\"\n    -- },\n    -- or:\n    -- \"com.ensarsarajcic.neovim.java:rplugin-hosted-example:0.4.2\"\n    },\n    -- Custom repositories\n    custom_repositories = {\n    -- Example:\n    -- {\n    --   id = \"github\",\n    --   url = \"https://maven.pkg.github.com/OWNER/REPOSITORY\"\n    -- }\n    }\n  },\n  -- Extend with a list of strings - additional classpath entries\n  -- If all classpath entries generated by the plugin are not enough\n  classpath_extras = {},\n  -- Library logging level - also affects storing of logs from the hosted plugins\n  log_level = \"info\",\n  autostart = true, -- set to false to prevent automatic start of plugins - must call start() then\n}\n```\n\n**NOTE**: When adding `.java` classes directly in `rplugin/java`, make sure to create directories for packages starting from `rplugin/java` as root. This means that any `.java` classes found in `rplugin/java` directly should have no package at all (implicit root package).\n\n### Functions\n\n- `require(\"java_plugin_host\").setup()` - main function for configuring the plugin, must be called before using any other function\n- `require(\"java_plugin_host\").start()` - start common plugin host and all standalone plugins - needed only if `autostart = false` or explicitly stopped\n- `require(\"java_plugin_host\").stop()` - stop common plugin host and all standalone plugins\n- `require(\"java_plugin_host\").restart()` - restart common plugin host and all standalone plugins - works only if already running\n- `require(\"java_plugin_host\").open_logs(key)` - open plugin logs - if key is omitted, shows common host logs, otherwise opends standalone plugin based on key - also mapped to `NeovimJavaLogs` - autocomplete is provided for keys\n- `require(\"java_plugin_host\").rebuild_classpath(callback)` - rebuild classpath used by the plugin and call callback with new classpath - can be useful to recompile all config and then restart the plugin\n- `require(\"java_plugin_host\").request(...)` - shortcut for `rpcrequest` which uses common host job id - example: `require(\"java_plugin_host\").request(\"my_custom_request_handler\", \"arg1\")`\n- `require(\"java_plugin_host\").notify(...)` - shortcut for `rpcnotify` which uses common host job id - example: `require(\"java_plugin_host\").notify(\"my_custom_notification_handler\", \"arg1\")`\n- `require(\"java_plugin_host\").get_standalone_jobs()` - returns table with all running standalone jobs\n\nClasspath can also be directly accessed with `require(\"java_plugin_host\").classpath` (only after `setup()` call).\n\n### Configuring nvim-jdtls\n\nIf using [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls), it can be configured to add classpath of the common host. This enables writing configuration directly in nvim config `rplugin/java` directory, as any other configuration file. It is recommended to keep separate nvim-jdtls configuration for nvim config, to prevent showing plugin autocomplete suggestions in other Java code. Example configuration can be found in [my dotfiles](https://github.com/esensar/dotfiles/blob/main/symlinks/config/nvim/lua/esensar/lsp/jdtls_setup.lua).\n\n```lua\nconfig.settings = {\n  java = {\n    ...\n    project = {\n      referencedLibraries = require(\"java_plugin_host\").classpath,\n    },\n    ...\n  },\n}\n```\n\n## Writing plugins for the host\n\nCheck out examples and templates:\n- **Example:** [neovim-http-api-plugin](https://codeberg.org/neovim-java/neovim-http-api-plugin) - *supports different ways of installation, highlighting differences*\n\n## Contributing\n\nCheck out [contributing guidelines](CONTRIBUTING.md).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesensar%2Fneovim-java-plugin-host","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesensar%2Fneovim-java-plugin-host","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesensar%2Fneovim-java-plugin-host/lists"}