我想将 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}
谁能帮我弄清楚?谢谢!