Gradle Drools 6.2不能解决配置“:compile”的所有依赖关系。

时间:2023-01-26 20:28:20

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.

我试图使用gradle来引入Drools 6.2,并不断得到以下错误。我读到它可能是一个有poms的repos的问题,但不是jar,但似乎不是这样。坦白地说,我有点不知所措,不知道该怎么做。

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:

这是我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.

对于未来的谷歌人,我们确定Drools是一个很差的等级。我们必须拼凑出一些技巧来保持它的正常运行,最后切换到Maven。就像所有的事情一样,YMMV。

1 个解决方案

#1


4  

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

如果你想告诉gradle看看不同的地方,你应该这样写:

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

#1


4  

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

如果你想告诉gradle看看不同的地方,你应该这样写:

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