如何避免在 Travis CI 上构建 Maven 的问题,而这些问题不会在本地发生? [英] How to avoid issues with Maven builds on Travis CI which don't occur locally?

查看:27
本文介绍了如何避免在 Travis CI 上构建 Maven 的问题,而这些问题不会在本地发生?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常使用 Travis CI 并且在过去几周在 Travis 上构建时注意到分叉项目的多个问题这不会发生在本地或分叉项目的 Travis 实例上.我确保我使用了与 Travis CI 环境相同的 Maven 版本,因为 Maven 和 Java 都可以跨平台移植.Travis 运行 Ubuntu 12.04 或 14.04,我也这样做(17.04).

I'm regularily using Travis CI and noticed multiple issues with forked projects the last weeks when building on Travis which do not occur locally or on the Travis instance of the forked project. I made sure that I used the the same Maven version which imo is all that can be different from the Travis CI environment since both Maven and Java are portable across platforms. Travis runs Ubuntu 12.04 or 14.04 which I do as well (17.04).

我经历的细节:

  • The failure to retrieve a SNAPSHOT version which I could retrieve with the same Maven version locally after deleting ~/.m2/repository and moving ~/.m2/settings.xml aside (see Why fails Travis CI to retrieve a SNAPSHOT artifact when retrieval works locally? for details)
  • [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.5.201505241946:check (default-check) on project commons-numbers-complex: Coverage checks have not been met. repeatedly which doesn't happen on their master branch (which I added to the aggregator of my project)

我不是在寻找此处问题的解决方案,而是寻求任何解释,以扩大我对跨平台环境中的 Travis 和 Maven 的理解.

I'm not looking for solutions to the issues here, but to any explanation how this could make any sense in order to broaden my understanding of Travis and Maven in a cross-platform environment.

推荐答案

您是否已固定在 Maven 中使用的所有插件?您应该首先修复您的构建问题,例如:[WARNING] 'parent.relativePath' of POM org.apache.commons:commons-numbers-parent:1.0-SNAPSHOT (/home/travis/build/document-scanner/document-scanner-aggregator/commons-numbers/pom.xml) 指向richtercloud:document-scanner-aggregator 而不是org.apache.commons:commons-parent,请验证你的项目结构@org.apache.commons:commons-numbers-parent:1.0-SNAPSHOT,/home/travis/build/document-scanner/document-scanner-aggregator/commons-numbers/pom.xml, line 19, column 11?

Have you pinned all plugins you use in Maven? You should first fix your build issues like : [WARNING] 'parent.relativePath' of POM org.apache.commons:commons-numbers-parent:1.0-SNAPSHOT (/home/travis/build/document-scanner/document-scanner-aggregator/commons-numbers/pom.xml) points at richtercloud:document-scanner-aggregator instead of org.apache.commons:commons-parent, please verify your project structure @ org.apache.commons:commons-numbers-parent:1.0-SNAPSHOT, /home/travis/build/document-scanner/document-scanner-aggregator/commons-numbers/pom.xml, line 19, column 11?

是否有充分的理由重建 apache-commons-numbers 而不是使用它们的已发布版本?

Is there a good reason why you rebuild apache-commons-numbers and not using the released versions of them?

这篇关于如何避免在 Travis CI 上构建 Maven 的问题,而这些问题不会在本地发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆