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 2a6394d285cf..bb6f45dba368 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 @@ -378,18 +378,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) {