Reputation: 15604
I have setup my .travis.yml as:
language: java
script: mvn clean verify
but I get
The command "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" failed and exited with 1 during
see https://github.com/WolfgangFahl/w3cValidator/blob/master/.travis.yml
What is wrong with this setup? Why is mvn install executed when I ask for mvn verify?
I had expected this to work based on:
https://stackoverflow.com/a/33283409/1497139
and checking the .travis.yml with http://lint.travis-ci.org/
Upvotes: 1
Views: 3011
Reputation: 5057
In general, I'd recommend using install: true
and placing the commands for the build under the script
element.
language: java
install: true
script:
- mvn install
There is an important difference between install
and script
: if the former fails, the build errors, if the latter one fails, the build fails. See the docs:
If
before_install
,install
orbefore_script
return a non-zero exit code, the build is errored and stops immediately.If
script
returns a non-zero exit code, the build is failed, but continues to run before being marked as failed.
Upvotes: 2
Reputation: 15604
I ended up with this style of yml file:
# this is a java project using maven
language: java
# install
install: mvn install
Upvotes: 0