Description of problem: The Workbench's Maven Repository is a protected resource meaning it needs (Basic Authentication) User credentials supplied in HTTP requests. It is impossible to use Drools Engine's UrlResource to add KJARs from the Workbench's Maven repository due to flawed implementation of Basic Authentication HTTP headers in the UrlResource class. Version-Release number of selected component (if applicable): 6.1.x (Product), 6.2.x (Community) How reproducible: Always Steps to Reproduce: Try to access the Workbench Maven Repository with something like this: KieServices ks = KieServices.Factory.get(); KieRepository kr = ks.getRepository(); UrlResource urlResource = (UrlResource) ks.getResources().newUrlResource("http://business-central/maven2/<path-to-JAR>.jar"); urlResource.setUsername("username"); urlResource.setPassword("password"); urlResource.setBasicAuthentication("enabled"); InputStream is = urlResource.getInputStream(); KieModule kModule = kr.addKieModule( ks.getResources().newInputStreamResource(is) ); Actual results: HTTP401/HTTP403 (see comments) Expected results: HTTP200
Verified on 6.1.0.ER5. The code is passing now. https://gitlab.mw.lab.eng.bos.redhat.com/bxms/brms/commit/8120ae62871b96b6d6616cebd64254043e42b90d