问题
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).
In detail I experienced:
- 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)
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.
回答1:
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
?
Is there a good reason why you rebuild apache-commons-numbers and not using the released versions of them?
来源:https://stackoverflow.com/questions/45359149/how-to-avoid-issues-with-maven-builds-on-travis-ci-which-dont-occur-locally