gpt4 book ai didi

java - KieScanner 无法从自定义 Maven 存储库获取最新的 Jars - Maven - 3.6.3

转载 作者:太空宇宙 更新时间:2023-11-04 09:05:26 25 4
gpt4 key购买 nike

我使用的是 drool 版本 7.x。我可以使用“LATEST”让 KieScanner 在我的本地 Maven 存储库上工作。但是每次我更新工作台上的规则时,我都必须手动运行 mvn install 才能更新我的本地存储库,以便KieScanner 可以拾取更改。是这样吗?或者是否可以在每次扫描仪运行时强制下载?

我需要从我的自定义存储库中获取最新的 jar。

我的配置

 KieServices ks = KieServices.Factory.get();
ReleaseId releaseId = ks.newReleaseId( "com.test", "poc", "LATEST" );

KieContainer kContainer = ks.newKieContainer(releaseId);
KieScanner kieScanner = ks.newKieScanner(kContainer);

kieScanner.start( 10000L );

Scanner scanner = new Scanner(System.in);

while (true) {
kieScanner.scanNow();
String line = scanner.nextLine();
runRule(kContainer);
}
}

我已在 Maven 设置文件中配置了自定义存储库。

     <profile>
<id>development</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>customRepo</id>
<url>https://customRepo/v2</url>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>development</activeProfile>
</activeProfiles>

Exception : Unable to resolve artifact: com.test :LATEST

我已经尝试了下面的所有链接。但运气不好

KieScanner cannot fetch LATEST version automatically!

KieScanner with remote maven repo

Loading Drools/KIE Workbench artifacts directly from the repository

How do I tell Maven to use the latest version of a dependency?

how do I tell maven 3.6.3 to get latest version of artifact from custom repository

https://access.redhat.com/solutions/1592893

KieScanner not updating KieSessions at runtime

KieScanner not working in Drools 6.1

KieScanner not updating jar from remote nexus repository (Drools 6.5.0.Final)

有人请建议解决这个问题吗?

最佳答案

LATESTRELEASE 是 Maven 2 关键字。它们的行为难以预测,并在 Maven 3 中被完全删除。

引用号。 https://www.baeldung.com/maven-dependency-latest-version#1-deprecated-syntax

关于java - KieScanner 无法从自定义 Maven 存储库获取最新的 Jars - Maven - 3.6.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60266133/

25 4 0
文章推荐: python - 你如何使用pygame创建按钮?
文章推荐: linux - 导致用户注销的 Bash 脚本
文章推荐: javascript - 如何让 保持固定高度? Bootstrap 4