java - Identify a specific incuded project class when they're multiple classes of same name -
i have (2+) projects included genxml
projet e.g. framework1
, framework2
. slighly different versions of same framework , both have class abstractscreentest.class
. each abstractscreentest.class
has different annotation
@myannotation(name="version", value = "71automation") @myannotation(name="version", value = "72automation")
is there anyway using annotation or other ways can specifiy abstractscreentest.class want use in code below @ moment first instance found used.
classpathscanningcandidatecomponentprovider provider = new classpathscanningcandidatecomponentprovider(true); provider.addincludefilter(new assignabletypefilter(abstractscreentest.class)); set<beandefinition> components = provider.findcandidatecomponents(candiatepackage);
it not spring problem, jvm cannot have 2 versions of class loaded simultaneously in 1 classloader.
the way load different version of same class use 2 different classloaders different classpaths. there no easy solution, if these frameworks use other classes interact.
Comments
Post a Comment