However, I believe it should be checking also for NoClassDefFoundError (see image):
I have a maven project with two modules:
moduleA
moduleB defines module A as optional dependency.
Then the client has the option to chose which combination of modules to add in their classpath - moduleA, moduleB, both modules or none of the modules.
If the customer selects moduleB only then I try to find subclasses:
and then it fails with NoClassDefFoundError because the index file in moduleB was created when moduleA was there during compile time but is missing at runtime now.
At the moment the
ClassIndex
is only checking for aClassNotFoundException
during class loading: https://github.com/atteo/classindex/blob/master/classindex/src/main/java/org/atteo/classindex/ClassIndex.java#L404-L406However, I believe it should be checking also for
NoClassDefFoundError
(see image):I have a maven project with two modules:
Then the client has the option to chose which combination of modules to add in their classpath - moduleA, moduleB, both modules or none of the modules.
If the customer selects moduleB only then I try to find subclasses:
and then it fails with
NoClassDefFoundError
because the index file in moduleB was created when moduleA was there during compile time but is missing at runtime now.