1

我想将 drools 工作台 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}

谁能帮我弄清楚?谢谢!

4

1 回答 1

0

目前 LATEST 工作得很好,前提是你总是使用固定版本。相反,如果您尝试将其与 SNAPSHOT 一起使用,则它确实已损坏并且无法使其正常工作。根据邮件链[1],答案只是“最新的被设计破坏”。[1] 然而,Maven 文档中也指出“为了可重现的构建,Maven 3.x 不再支持使用这些元版本”。[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

于 2017-05-11T04:20:03.230 回答