diff --git a/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java b/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java index c87ad1e53f0..979b2b4375c 100644 --- a/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java +++ b/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieBuilderImpl.java @@ -374,18 +374,13 @@ private static boolean isFileInKieBase( KieBaseModel kieBase, String fileName, S return true; } else { String folderNameForFile = lastSep > 0 ? fileName.substring( 0, lastSep ) : ""; - int resourcesPos = folderNameForFile.indexOf( RESOURCES_ROOT ); - if (resourcesPos >= 0) { - folderNameForFile = folderNameForFile.substring( resourcesPos + RESOURCES_ROOT.length() ); - } String pkgNameForFile = packageNameForFile( fileName, folderNameForFile, !useFolders, file ); return isPackageInKieBase( kieBase, pkgNameForFile ); } } private static String packageNameForFile( String fileName, String folderNameForFile, boolean discoverPackage, Supplier file ) { - String packageNameFromFolder = folderNameForFile.replace( '/', '.' ); - + String packageNameFromFolder = getRelativePackageName(folderNameForFile.replace( '/', '.' )); if (discoverPackage) { String packageNameForFile = packageNameFromAsset(fileName, file.get()); if (packageNameForFile != null) {