I would like to discover all implementations of an interface during runtime in a Java app, and load those classes dynamically from JAR files that the user can add to a folder. It's a plug-in system, basically.
I found a few solutions for this:
- Use SPI -- this is not very flexible: I'd like something that maybe works with annotations, or just looks for an interface that is extended, without having to add external text files, too.
- Use Commons Discovery -- looks like a dead end, as the last release is 0.4 from back in 2005
- Use Java Simple Plugin Framework. 5 minutes and it works. No XML. -- this looks like very immature.
Are there any other widely used solutions for this?
Update: There is no need for code separation, and OSGi seems to be far too complex for my simple needs right now. I also added "Simple" to the title of this question to clarify my intentions.