title: Avoid parsing project pom.xml when running Drools
body: <p>this is a follow up question to <a href="https://stackoverflow.com/questions/22322433/using-drools-6-maven-architecture-completely-offline">a question I asked earlier</a>.</p>
  
  <p>I am using Drools 6.1.0.Beta1 in a project with the following (shortened) pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;de.test.configuration&lt;/groupId&gt;
      &lt;artifactId&gt;someTest&lt;/artifactId&gt;
      &lt;version&gt;0.7.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;name&gt;droolsTest&lt;/name&gt;
  
      &lt;parent&gt;
              &lt;groupId&gt;de.test&lt;/groupId&gt;
              &lt;artifactId&gt;maven-parent&lt;/artifactId&gt;
              &lt;version&gt;0.3&lt;/version&gt;
      &lt;/parent&gt;
  
      &lt;dependencies&gt;
              &lt;!-- The Drools rule engine --&gt;
              &lt;dependency&gt;
                      &lt;groupId&gt;org.drools&lt;/groupId&gt;
                      &lt;artifactId&gt;drools-core&lt;/artifactId&gt;
                      &lt;version&gt;6.1.0.Beta1&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;dependency&gt;
                      &lt;groupId&gt;org.drools&lt;/groupId&gt;
                      &lt;artifactId&gt;drools-compiler&lt;/artifactId&gt;
                      &lt;version&gt;6.1.0.Beta1&lt;/version&gt;
              &lt;/dependency&gt;
              &lt;!-- getting maven artefacts --&gt;
              &lt;dependency&gt;
                      &lt;groupId&gt;org.kie&lt;/groupId&gt;
                      &lt;artifactId&gt;kie-ci&lt;/artifactId&gt;
                      &lt;version&gt;6.1.0.Beta1&lt;/version&gt;
              &lt;/dependency&gt;
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>For the internal maven, used within KIE/Drools, I have a separate settings.xml, which is configured with the property -Dkie.maven.settings.custom="X:\droolsmaven\settings.xml"
  The contents of this file are:</p>
  
  <pre><code>&lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                    http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
  
      &lt;localRepository&gt;x:/droolsmaven/repository&lt;/localRepository&gt;
  
      &lt;profiles&gt;
              &lt;profile&gt;
                      &lt;id&gt;mavenDroolsProfile&lt;/id&gt;
                      &lt;activation&gt;
                              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
                      &lt;/activation&gt;
  
                      &lt;repositories&gt;
  
                              &lt;repository&gt;
                                      &lt;id&gt;someRepo&lt;/id&gt;
                                      &lt;url&gt;http://1.2.3.4&lt;/url&gt;
                                      &lt;releases&gt;
                                              &lt;enabled&gt;false&lt;/enabled&gt;
                                      &lt;/releases&gt;
                                      &lt;snapshots&gt;
                                              &lt;enabled&gt;false&lt;/enabled&gt;
                                      &lt;/snapshots&gt;
                              &lt;/repository&gt;
  
                              &lt;repository&gt;
                                      &lt;id&gt;central&lt;/id&gt;
                                      &lt;url&gt;http://repo1.maven.org/maven2&lt;/url&gt;
                                      &lt;releases&gt;
                                      &lt;enabled&gt;false&lt;/enabled&gt;
                                      &lt;/releases&gt;
                                      &lt;snapshots&gt;
                                              &lt;enabled&gt;false&lt;/enabled&gt;
                                      &lt;/snapshots&gt;
                              &lt;/repository&gt;
                      &lt;/repositories&gt;
              &lt;/profile&gt;
      &lt;/profiles&gt;
  
  &lt;/settings&gt;
  </code></pre>
  
  <p>In that local repository, the respective artifact used later is deployed, which is working, confirmed with a non-maven-project.</p>
  
  <p>Now, when trying running the following code within the maven project which is defined by the above mentioned pom, I get the errors mentioned after this code block:</p>
  
  <pre><code>public class MainKieTest {
  
  public static void main(String[] args) {
      KieServices ks = KieServices.Factory.get();
  
      KieRepository repository = ks.getRepository();
      ReleaseId releaseId = ks.newReleaseId("de.test.package", "artifact", "1.0.1");
  
      KieContainer kieContainer = ks.newKieContainer(releaseId);
  
      KieScanner kieScanner = ks.newKieScanner(kieContainer);
      kieScanner.scanNow();
  }
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>DEBUG [main] (KieRepositoryImpl.java:92) - KieModule Lookup. ReleaseId de.test.package:artifact:1.0.1 was not in cache, checking classpath DEBUG [main] (KieRepositoryImpl.java:98) - KieModule Lookup. ReleaseId de.test.package:artifact:1.0.1 was not in cache, checking maven repository  WARN [main] (MavenSettings.java:47) - Environment variable M2_HOME is not set DEBUG [main] (Logs.java:390) - Add publisher: com.google.inject.internal.InjectorImpl@5221dfe5
  
  -----[explicit bindings]-------------------------------------------------------
  0. ProviderInstanceBinding{key=Key[type=com.google.inject.Injector, annotation=[none]], source=[unknown source], scope=Scopes.NO_SCOPE, provider=Provider&lt;Injector&gt;} [...] lines cut for brevity 198. ConstructorBinding{key=Key[type=org.apache.maven.lifecycle.DefaultSchedules, annotation=[none]], source=ClassRealm[maven, parent: ClassRealm[maven-parent, parent: null]], scope=Scopes.SINGLETON} -----[implicit bindings]-------------------------------------------------------
  -------------------------------------------------------------------------------
  
  Exception in thread "main" java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
  [FATAL] Non-resolvable parent POM: Could not find artifact de.test:maven-parent:pom:0.3 and 'parent.relativePath' points at wrong local POM @ line 15, column 10
  
          at org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:21)
          at org.kie.scanner.embedder.MavenProjectLoader.loadMavenProject(MavenProjectLoader.java:48)
          at org.kie.scanner.Aether.&lt;init&gt;(Aether.java:44)
          at org.kie.scanner.Aether.getAether(Aether.java:54)
          at org.kie.scanner.MavenRepository.getMavenRepository(MavenRepository.java:53)
          at org.kie.scanner.ArtifactResolver.&lt;init&gt;(ArtifactResolver.java:36)
          at org.kie.scanner.KieRepositoryScannerImpl.getArtifactResolver(KieRepositoryScannerImpl.java:77)
          at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:87)
          at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:83)
          at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:114)
          at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:100)
          at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:77)
          at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:106)
          at de.test.configuration.kie.MainKieTest.main(MainKieTest.java:40)
  Caused by: org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
  [FATAL] Non-resolvable parent POM: Could not find artifact de.test:maven-parent:pom:0.3 and 'parent.relativePath' points at wrong local POM @ line 15, column 10
  
          at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
          at org.kie.scanner.embedder.MavenEmbedder.buildProjects(MavenEmbedder.java:335)
          at org.kie.scanner.embedder.MavenEmbedder.readProjects(MavenEmbedder.java:319)
          at org.kie.scanner.embedder.MavenEmbedder.readProject(MavenEmbedder.java:312)
          at org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:19)
          ... 13 more
  </code></pre>
  
  <p>The problem seems to be, that the Maven which is internal to Drools/KIE, also tries to build the complete dependency tree, given by the pom.xml of the project in which KIE runs.</p>
  
  <p>IMHO, this should not be, because the maven artifacts deployed for Drools, used at runtime, are independent from the artifacts used for building the project itself; those are needed at buildtime.</p>
  
  <p>Is this problem just a misconception of how I think Drools should work or is it an actual bug?</p>