我想将流口水工作台 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();
}
}
以下是我的设置.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 存储库中。当我第一次启动应用程序时,它会写入一个名为"解析器状态.properties"的跟踪文件,并且该文件记录了一些 timstamp ,因此本地服务器不再获取在 nexus 服务器中较新的 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}
谁能帮我弄清楚?谢谢!
目前,只要您始终使用固定版本,LATEST 就可以很好地工作。相反,如果您尝试将其与快照一起使用,它确实已损坏,无法使其工作。根据邮件链[1],答案只是"LATEST 被设计破坏了"。[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