I am working on delivering a new feature for a Java based enterprise application. A lot of workareas/projects will be uptaking my feature. But I am not willing that we import the jar containing the new feature and include it in all individual classpaths for all projects. I have been wondering wether it would be possible at all to instantiate a java object to use there methods, but without importing the containing jar in the project's classpath. Other than the generic methods to instantiate a java object: new, clone(), ApplicationContext.getBean/ autowiring in spring framework to mention a few, but these all generally expect the containing jar to be present in the context. Is there any possibility across any java based framework which could facilitate this programming routine?
One working example is from Oracle ADF, where we can make use of ApplicationModule in the data model. And with the help of the applicationModule instance, we can access any view object (read: java object) across any project in the workspace without importing the containing jar in classpath.