Java 当检索在本地工作时,为什么Travis CI检索快照工件失败?

Java 当检索在本地工作时,为什么Travis CI检索快照工件失败?,java,maven,travis-ci,Java,Maven,Travis Ci,我在Travis CI上遇到了一个无法解释的问题,因为在删除~/.m2/repository并将~/.m2/settings.xml移动到备份位置后,我在本地运行了完全相同的构建命令 错误消息是 [ERROR] Failed to execute goal org.codehaus.izpack:izpack-maven-plugin:5.1.1:izpack (default) on project document-scanner: Execution default of goal org

我在Travis CI上遇到了一个无法解释的问题,因为在删除
~/.m2/repository
并将
~/.m2/settings.xml
移动到备份位置后,我在本地运行了完全相同的构建命令

错误消息是

[ERROR] Failed to execute goal org.codehaus.izpack:izpack-maven-plugin:5.1.1:izpack (default) on project document-scanner: Execution default of goal org.codehaus.izpack:izpack-maven-plugin:5.1.1:izpack failed: 
Plugin org.codehaus.izpack:izpack-maven-plugin:5.1.1 or one of its dependencies could not be resolved: 
The following artifacts could not be resolved: 
org.apache.commons:commons-numbers-core:jar:1.0-SNAPSHOT,
org.apache.commons:commons-numbers-gamma:jar:1.0-SNAPSHOT,
org.apache.commons:commons-numbers-fraction:jar:1.0-SNAPSHOT,
org.apache.commons:commons-numbers-combinatorics:jar:1.0-SNAPSHOT,
org.apache.commons:commons-numbers-arrays:jar:1.0-SNAPSHOT,
org.apache.commons:commons-numbers-angle:jar:1.0-SNAPSHOT,
org.apache.commons:commons-rng-sampling:jar:1.1-SNAPSHOT:
Could not find artifact org.apache.commons:commons-numbers-core:jar:1.0-SNAPSHOT`
这让我觉得快照版本是izpackmaven插件所必需的,所以我无法避免它

Afaik应该根据
pom.xml
s中的
repository
元素提取存储库,这些元素在本地和Travis CI方面是相等的。该问题出现的时间超过12小时,现在是100%(Travis CI构建重新启动了3次),因此不太可能出现缓存问题

我正在使用Maven 3.1.1,它由一个我修改过的依赖项强制执行,我正在聚合器项目中构建该依赖项。

添加

<repositories>
    <repository>
        <id>apache-snapshots-group</id>
        <name>Apache snapshots group repository</name>
        <url>https://repository.apache.org/content/groups/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
        <!-- fix missing `commons-numbers-core:1.0-SNAPSHOT` on Travis CI
        -->
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>apache-snapshots-group</id>
        <name>Apache snapshots group repository</name>
        <url>https://repository.apache.org/content/groups/snapshots</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </pluginRepository>
        <!-- fix missing `commons-numbers-core:1.0-SNAPSHOT` on Travis CI
        -->
</pluginRepositories>

apache快照组
Apache快照组存储库
https://repository.apache.org/content/groups/snapshots
真的
真的
apache快照组
Apache快照组存储库
https://repository.apache.org/content/groups/snapshots
真的
真的

POM修复了Travis CI上的问题,尽管这并不能解释为什么在本地使用重置系统构建时不需要它(请参阅以获取最终解释)。

您真的需要Apache项目的快照版本吗?快照版本似乎声明为
izpack maven插件的依赖项,所以我现在无法控制它。你可以尝试在pom.xml中排除它,然后自己添加一个非快照版本作为依赖项。