Search code examples
javamavengradledrools

Gradle Drools 6.2 Could not resolve all dependencies for configuration ':compile'


I'm trying to pull in Drools 6.2 using gradle and keep getting the following error. I read that it could be an issue with repos that have poms, but not jars, but that doesn't seem to be the case. Frankly I'm a bit stuck and don't know how to proceed here.

Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.kie:kie-api:6.2.0.Final.
  Required by:
      1:1:1
   > Could not resolve org.kie:kie-api:6.2.0.Final.
      > Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-api/6.2.0.Final/kie-api-6.2.0.Final.pom
         > Could not resolve org.kie:kie-api-parent:6.2.0.Final.
            > Could not resolve org.kie:kie-api-parent:6.2.0.Final.
               > Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-api-parent/6.2.0.Final/kie-api-parent-6.2.0.Final.pom
                  > Could not resolve org.kie:kie-parent-with-dependencies:6.2.0.Final.
                     > Could not resolve org.kie:kie-parent-with-dependencies:6.2.0.Final.
                        > Could not parse POM http://repo1.maven.org/maven2/org/kie/kie-parent-with-dependencies/6.2.0.Final/kie-parent-with-dependencies-6.2.0.Final.pom
                           > Could not find org.jboss.dashboard-builder:dashboard-builder-bom:6.2.0.Final.
                             Searched in the following locations:
                                 http://repo1.maven.org/maven2/org/jboss/dashboard-builder/dashboard-builder-bom/6.2.0.Final/dashboard-builder-bom-6.2.0.Final.pom
                                 http://repo1.maven.org/maven2/org/jboss/dashboard-builder/dashboard-builder-bom/6.2.0.Final/dashboard-builder-bom-6.2.0.Final.jar

Here is my build.gradle:

apply plugin: 'java'
apply plugin: 'eclipse'

group = '1'
version = '1'

description = ""

repositories {
  maven {
    url 'http://repo1.maven.org/maven2'
    artifactUrls 'http://repository.jboss.org/nexus/content/groups/public-jboss'
  }
}
ext {
 droolsVersion = '6.2.0.Final'
}
dependencies {
 compile "org.kie:kie-api:$droolsVersion"
 compile "org.drools:drools-core:$droolsVersion"
 compile "org.drools:drools-compiler:$droolsVersion"
}

I've also tried:

repositories {
    mavenCentral()
}

EDIT:

For future googlers, we determined that Drools is a very poor match for Gradle. We had to cobble together a number of hacks to keep it working, and ended up switching to Maven. As with all things, YMMV.


Solution

  • If you want to tell gradle to look at different locations you should write the repositories like this:

    repositories {
        maven {
        name 'central'
        url 'http://repo1.maven.org/maven2'
        }
        maven {
        name 'jboss'
        url 'http://repository.jboss.org/nexus/content/groups/public-jboss'
        }
      }