Add CLI options to load plugins from extra jars and directories#1816
Add CLI options to load plugins from extra jars and directories#1816vjh0107 wants to merge 1 commit into
Conversation
How will this work if #1736 gets merged? Mounting a read-only volume for plugin jars would break the plugin update feature this PR is attempting to implement. |
|
The readonly thing here is only about the extra plugin paths from the new CLI options (immutable jars, e.g. mounted from a container image). #1736's update folder lives under the normal plugins/ dir, which stays writable like it is now. |
|
@WouterGritter If there's anything else I need to do, please feel free to tell me! |
I'm not a maintainer with any rights on this repository, just a contributor sharing their thoughts :) |
Hi! This PR adds two cli options which allow loading additional plugin jars and directories in addition to the default plugins folder.
The data directory is intentionally kept fixed rather than tied to the plugin jar location. Paper takes the same approach, and since this option is likely to be used together with container volumes, which are often mounted readonly, keeping mutable data separate from the plugin binaries seems like the safer choice.
https://github.com/PaperMC/Paper/blob/216388dfdf25b365e0d3ec24748def4dcaa30a76/paper-server/src/main/java/io/papermc/paper/plugin/entrypoint/classloader/PaperPluginClassLoader.java#L176
For this reason, loadPlugins still keeps the directory argument so it can be used for the data directory.
https://github.com/vjh0107/Velocity/blob/feat/cli-extra-plugins/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityPluginManager.java#L91~L94