Loading Jar into classpath which is not defined in pom.xml

27 Views Asked by At

I am working on a Maven Java application where I need to dynamically load Plain Old Java Objects (POJOs) into the classpath upon application restart. This loading should be based on environment parameters passed during the application startup.

For example, let's say I have different sets of POJOs corresponding to different environments like development, testing, and production. Upon restarting the application with different environment parameters, I want to load the appropriate set of POJOs into the classpath.

I have looked into using ClassLoaders, but I'm unsure about how to implement this dynamically based on environment parameters. Can someone provide guidance or code examples on how to achieve this?

0

There are 0 best solutions below