What are the best pratices, frameworks, librairies to integrate Java plugins?

OK! Lets first state that I am a senior software developer, but it makes a little while I did not start from scratch a new software. I already looked around, but I would like to have your opinions and maybe a discussion. Thank you in advance!

Requirements:

  • Shall be using plugins
  • Plugins may or may not have dependencies (maybe even between plugins, but I am not sure at this point)
  • The software will be able to support three starting modes (so only one at a time):
    • Command line
    • Web Server (which will include the frontend)
    • A window version
  • This will be an opensource project

Current development:

What I already have is something really basic. It is currently divided into two projects:

  • SoftwareBase: It is giving currently the possibility to start with two modes: Command line OR Window mode. The goal of this would be to not have to create a new base each time.
  • The software itself: That depends on the SoftwareBase one.

Within each projects, there are currently a package that includes all the commands (one per class) that can be executed and shall support the three modes (or maybe other classes would transpose their return (when there is) to the specific output (window, web, command line)).

So any new plugins could import their own commands. I already think about external or internal commands that, respectively, could be called by command line / programmatically or could only be called via a line of code.

Questions:

  1. I was asking myself if the web mode support shall be integrated as a plugin or being native.
  2. I already looked at dynamic JAR loading, but shall I implement this or is there any thing I could use already built? (I know there is, but remember I am reaching for your opinion)
  3. What do you think in general of this?

Thank you again for your guidance!