【发布时间】:2016-10-26 12:11:16
【问题描述】:
我正在使用 Drools 6.4 和 KieScanner 在 KieBase 中进行自动更新。我已经设置了远程存储库并在 settings.xml 中指定了它。
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>useArtifactory</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>abc</id>
<url>My remote artifactory</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>useArtifactory</activeProfile>
</activeProfiles>
</settings>
当我的应用程序第一次运行时,它在本地 maven 中找不到 jar,所以它从远程存储库下载。我有 KieScanner,它每 10 秒扫描一次 maven repo。但问题是,如果远程仓库中有任何更新,那么更新不会被即时下载。我正在使用 jar 的固定版本 1.0。我在这里错过了什么?
【问题讨论】:
-
在 maven 中,固定版本的 jar 永远不会重新下载,因为它们永远不会改变。所以要么使用 SNAPSHOT VERSION 并使用 -U (force update dependencies for SNAPSHOT) 运行 mvn,或者最终使用版本范围。 (不鼓励,因为它会影响构建的可重复性)。
标签: java maven maven-2 maven-3 drools