I want to make sure that a JAR won't throw NoClassDefinitionFound exception before it is deployed to a server. More advanced requirement is to be able to specify additional class paths.
How this can be done?
I want to make sure that a JAR won't throw NoClassDefinitionFound exception before it is deployed to a server. More advanced requirement is to be able to specify additional class paths.
How this can be done?
In general it is not possible since your JAR file can load classes dynamically using Class.forName()
or ClassLoader.loadClass()
methods
I would say that the proper approach is to use some dependency management tool during your build process which will assemble all the dependencies for you.
Maven war plugin will do it for you automatically