Drop-in external dependencies at runtime.

Skip to first unread message

Igor Urisman

Jul 25, 2018, 2:13:42 PM7/25/18
to play-fr...@googlegroups.com
Dear Players

I distribute my play app as a server which is run by my customers on-prem. One of the features I publish is a server-side API, enabling them to drop-in code that runs in the server's address space. This code is compiled as a jar file and dropped into the directory ext/ created by my install, at the same level as the regular lib/ directory.

The problem is that I don't have a good way to make these dependencies found by the class loader. I've written a custom class loader, which works fine, so long as it's my code that does the loading. Which is the case when I instantiate top-level custom classes, but not further down the chain, e.g. a JDBC driver or a Kafka client, dependent on by client code.

The stopgap solution I've found is to append ':/path/to/server/ext/*' to the long, hard-coded (for a good reason - I get it) list of app-classpath inside the application bootup bash script (line 341 in 2.6). Wondering if there isn't a better solution. For instance, why not honor the classpath env variable?

Or something else altogether?

Thanks in advance,
Reply all
Reply to author
0 new messages