Drools KieScanner无法自动获取SNAPSHOT版本!

时间:2017-05-10 08:06:19

标签: maven drools drools-guvnor kie-workbench

我想将drools workbench 6.5.0.Final与我的应用程序集成。 代码如下:

 private static void test() throws InterruptedException {
        KieServices kServices = KieServices.Factory.get();
        ReleaseId releaseId = kServices.newReleaseId("com.risk", "core-engine-test", "1.0.0-SNAPSHOT");
        kContainer = kServices.newKieContainer(releaseId);

        KieScanner kScanner = kServices.newKieScanner(kContainer);
        kScanner.start(10000L);

        Person p = new Person("郭芙蓉", 8);
        System.out.println("orig p1 : " + p);
        while (true) {
           Thread.sleep(5000);
           KieSession ksession = kContainer.newKieSession("testSession");
                ksession.insert(p);
                ksession.fireAllRules();
                System.out.println("after p1 : " + p);
                ksession.dispose();
            }
  }

以下是我自己的应用程序使用的settings.xml。

  <mirrors>
        <mirror>
            <id>nexus</id>
            <url>http://10.240.132.81:8081/nexus/content/groups/public/</url>
            <name>nexus</name>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>

我安装并将kjar部署到我的nexus存储库中。当我第一次启动应用程序时,它会编写一个名为“resolver-status.properties”的跟踪文件,并且此文件会记录一些timstamp,因此本地服务器不会不再在nexus-server中获取更新的jar。我得到了这样的日志:

05-10 15:59:48.657 Not in OSGi: using plexus based maven parser
05-10 15:59:50.168 Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/username/.m2/repository
05-10 15:59:50.175 Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/username/.m2/repository
05-10 15:59:50.231 Using mirror nexus (http://10.240.132.81:8081/nexus/content/groups/public/) for central (https://repo.maven.apache.org/maven2).
05-10 15:59:50.262 Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/username/.m2/repository
05-10 15:59:50.277 KieModule Lookup. ReleaseId com.risk:core-engine-test:1.0.0-SNAPSHOT was not in cache, checking classpath
05-10 15:59:50.277 KieModule Lookup. ReleaseId com.risk:core-engine-test:1.0.0-SNAPSHOT was not in cache, checking maven repository
05-10 15:59:50.288 Skipped remote request for com.risk:core-engine-test:1.0.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
05-10 15:59:50.588 Skipped remote request for com.risk:core-engine-test:1.0.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
05-10 15:59:50.588 Skipped remote request for com.risk:core-engine-test:1.0.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
05-10 15:59:50.589 Skipped remote request for com.risk:core-engine-test:1.0.0-SNAPSHOT/maven-metadata.xml, locally cached metadata up-to-date.
05-10 15:59:50.608 Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=1, ConflictMarker.nodeCount=1, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=18, DefaultDependencyCollector.transformTime=10}

任何人都可以帮我搞清楚吗?谢谢!

1 个答案:

答案 0 :(得分:0)

目前LATEST工作得很好,前提是你总是使用固定版本。相反,如果你尝试将它与SNAPSHOTs一起使用,它确实被破坏了,它是不可能的。 根据邮件链[1],答案就是那个&#34; LATEST被设计打破了#34;。 [1]然而,在Maven文档中也说明了&#34;为了可重现的构建,Maven 3.x不再支持使用这些metaversions&#34;。 [2]

[1] https://dev.eclipse.org/mhonarc/lists/aether-users/msg00529.html [2] https://cwiki.apache.org/confluence/display/MAVEN/Maven+3.x+Compatibility+Notes#Maven3.xCompatibilityNotes-PluginMetaversionResolution