I’m writing an FTP client plugin for a open source ETL utility (Pentaho Data Integration). PDI uses an old version of the Apache commons NET jar by default, and I need functionality that is provided by the newer versions.
I’d prefer not to affect everything in Pentaho by replacing the old JAR with the new one. Is it possible for me to keep them along side each other and just tell my new code to import specifically from the new JAR I added?
You can’t do that from the plugin code itself. You can only do that if the plugin is loaded in a different classloader, which would need to be configured to load classes from your own apache commons jar before going to the parent classloader.
Most application servers do that: you can add a lib folder and that will be used by your code before the application server’s own libraries.
Other application servers support OSGi, which allows you to deploy multiple version of the same library, providing they have the correct MANIFEST.MF file. In that case, you can specify which version you need in your own MANIFEST.MF file.
Pentaho Kettle supports OSGi plugins, apparently.