Duplicate checks ignore multiple persistence files in multiple JARS

0 views
Skip to first unread message

Marc Magon

unread,
Oct 2, 2017, 7:38:06 AM10/2/17
to FastClasspathScanner-Users
Hi Guys,

Having a problem reading persistence.xml files from multiple Jars with this library, Seems to be finding it as duplicates (META-INF/persistence.xml). 
Only the first item is found and matched.

scanner.enableFieldInfo();
scanner.enableFieldAnnotationIndexing();
scanner.enableFieldTypeIndexing();
scanner.enableMethodAnnotationIndexing();
scanner.enableMethodInfo();
scanner.ignoreFieldVisibility();
scanner.ignoreMethodVisibility();
scanner.disableRecursiveScanning(false);


scanner.matchFilenamePattern("(.*)?persistence\\.xml", (File classpathElt, String relativePath, byte[] fileContents) -> {
log.warning("Found Persistence XML File : " + ClasspathUtils.getClasspathResourceURL(classpathElt, relativePath));
}
);

Luke Hutchison

unread,
Oct 2, 2017, 4:59:16 PM10/2/17
to Marc Magon, FastClasspathScanner-Users
Yes, that was actually intentional, to honor "classpath masking semantics", where if there are multiple classes with the same exact package and class name on the classpath, only the first will be loaded, and the rest ignored. However, I see that this is not probably expected or useful for FileMatchProcessors, so I'll change it.

Luke Hutchison

unread,
Oct 2, 2017, 5:12:08 PM10/2/17
to Marc Magon, FastClasspathScanner-Users
Should be fixed in 2.7.2. Please let me know.
Reply all
Reply to author
Forward
0 new messages