Description of problem: This issue relates to BRMS Integration with Fabric and more specifically to how Drools is loading KJARs from Maven. In this case, drools does not use the fabric maven proxy or any of the configured maven repo's in fabric to load a KJAR. It uses 3 potential methods; 1) a drools CUSTOM_SETTINGS_PROPERTY pointing to a settings.xml 2) the 'userHome + "/.m2/settings.xml"' 3) the artifact is in 'userHome + "/.m2/repository"' This is because the KJAR is loaded by KIE specific logic and not as bundle loaded through a feature or profile. Because fabric customers manage resources and configurations through the fabric, this represents additional configuration that is hard to track and maintain. A KJAR is current loaded as follows; 1) InternalKieModule kieModule = (InternalKieModule) getRepository().getKieModule(releaseId); https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieServicesImpl.java#L114 2) return getKieModule(releaseId, null); https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieRepositoryImpl.java#L92 3) kieModule = loadKieModuleFromMavenRepo(releaseId, pomModel); https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieRepositoryImpl.java#L105 4) return getInternalKieScanner().loadArtifact(releaseId, pomModel); https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieRepositoryImpl.java#L129 5) return internalKieScanner; -> InternalKieScanner https://github.com/droolsjbpm/drools/blob/6.3.x/drools-compiler/src/main/java/org/drools/compiler/kie/builder/impl/KieRepositoryImpl.java#L133 6) KieRepositoryScannerImpl implements InternalKieScanner https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/KieRepositoryScannerImpl.java 7) getArtifactResolver(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/KieRepositoryScannerImpl.java#L118 8) mavenRepository = MavenRepository.getMavenRepository(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/ArtifactResolver.java#L52 9) defaultMavenRepository = new MavenRepository( defaultAether ); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/MavenRepository.java#L78 10) remoteRepositoriesForRequest = initRemoteRepositoriesForRequest(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/MavenRepository.java#L67 11) final MavenRepositoryConfiguration repositoryUtils = getMavenRepositoryConfiguration(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/MavenRepository.java#L87 12) return MavenSettings.getMavenRepositoryConfiguration(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/MavenRepository.java#L70 13) return SettingsHolder.mavenConf; https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/embedder/MavenSettings.java#L49 14) private static final MavenRepositoryConfiguration mavenConf = new MavenRepositoryConfiguration(settings); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/embedder/MavenSettings.java#L35 In terms of artifact resolution, everything happens based on the configured maven settings above in step 14. For USER settings, it's looking for: private static File initUserSettingsFile() 1) CUSTOM_SETTINGS_PROPERTY or 2) File userSettingsFile = new File( userHome + "/.m2/settings.xml" ); Otherwise it returns null. Then it initializes settings: private static Settings initSettings(File userSettingsFile) 1) Is user settings wasn't null; request.setUserSettingsFile( userSettingsFile ); 2) Look for M2_HOME - set global settings File globalSettingsFile = new File( mavenHome + "/conf/settings.xml" ); 3) If user.home is set, sets the local repository: settings.setLocalRepository( userHome + "/.m2/repository" ); Finlly; 15) All of the repos from the found settings are initialized: this.extraRepositories = initExtraRepositories(); this.remoteRepositoriesForRequest = initRemoteRepositoriesForRequest(); this.artifactRepositoriesForRequest = initArtifactRepositories(); https://github.com/droolsjbpm/drools/blob/6.3.x/kie-ci/src/main/java/org/kie/scanner/MavenRepositoryConfiguration.java#L43 Version-Release number of selected component (if applicable): BRMS 6.2.x BRMS 6.3 How reproducible: 100% Steps to Reproduce: 1. Deploy an application which loads a KJAR and only configure the maven repository or settings.xml in fabric. Actual results: KJAR artifact is unable to be found. Expected results: Should resolve and download the correct artifact. Additional info: In the customers eyes, in a fabric environment, drools should plug into fabric and leverage the already configured remote / local repositories configured within the environment.
Talked with Mario. On newer version of drools, this should be fixed. It is required to export a property kie.maven.settings.custom that contains the url of the settings.xml
Fixing commit [1] is not present on 6.4.x branch of droolsjbpm/drools repository. [1] https://github.com/droolsjbpm/drools/pull/719/commits/449b5d2de838c8de29868706c982e4865c2fce47
Discussed this with Lazarotti and the expectation is to have this fix for 6.3.1, not 6.3.0.
6.3.1 and 6.2.3 (by Bug 1325016)
After further discussion with Alessandro on IRC, it will be complicated if we have the fix in 6.2.3 but not in 6.3.0. So we will include the fix in 6.3.0. Resetting the flags.
Cherry-picked to branch 6.4.x with https://github.com/droolsjbpm/drools/commit/d04eb3b97
Fixed on master by https://github.com/droolsjbpm/drools/commit/88fe6fa70
Cherry-picked to 6.4.x branch with https://github.com/droolsjbpm/drools/commit/b79b4efb8