Drools: cannot start container on remote kie-server, for “Could not find artifact …”

北慕城南 提交于 2019-12-11 20:40:21

问题


On a server with drools workbench and KIE server both installed, I authored a project, and got it built and deployed. Also, I can start a container for it locally.

But I could not create a container for it on a remote server, and got the following error on remote server:

Unable to resolve artifact: testdrools:firstApplication:pom:1.3
org.eclipse.aether.resolution.ArtifactResolutionException: Could not find artifact testdrools:firstApplication:pom:1.3 in central (http://repo1.maven.org/maven2/)

With the limited knowledge on MAVEN I learnt from this, it seems what the KIE server tries to resolve, "testdrools:firstApplication:pom:1.3", does exist, since part of the pom.xml extracted from *.jar file is as follows:

  <groupId>testdrools</groupId>
  <artifactId>firstApplication</artifactId>
  <version>1.3</version>
  <name>firstApplication</name>
  <build>
    <plugins>
      <plugin>
        <groupId>org.kie</groupId>
        <artifactId>kie-maven-plugin</artifactId>
        <version>6.2.0.Final</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
</project>

Could somebody give me any hint on why I can't create a remote container for this case?


We found a workaround for this problem. While trying to re-produce this problem, we got the error again:

Could not find artifact droolstest:droolsTestProj2:pom:1.1 in local (file:/root/.m2/repository/)

So we downloaded the "droolsTestProj2-1.1.jar" file from artifact repository of workbench, and copy it to "/root/.m2/repository/droolstest/droolsTestProj2/1.1". Container started up after refreshing.

It seems workbench failed to send the *.jar file to KIE server. Share your ideas on this, please.


回答1:


Can you try to set a custom settings.xml which would contain reference to local repository? This repository can be shared between workbench and Kie server.

To set a custom settings.xml you need to define the system property "kie.maven.settings.custom" in containers where you run applications.

This property should reference to location of your settings.xml file. In that file you should define tag <localRepository>, which will reference the directory where you will place the local repository shared between workbench and Kie server.

For more info, see the Drools Documentation.



来源:https://stackoverflow.com/questions/31613634/drools-cannot-start-container-on-remote-kie-server-for-could-not-find-artifac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!