简体   繁体   中英

Travis uses ant instead of maven

I have a repo with 3 maven projects for which I want to use Travis.

As the pom.xml is not in the root of the repo, Travis doesn't see it and tries to build with build.xml , but it fails.

I tried setting custom build script, but Travis seems not to keep trying to build with Ant .

My .travis.yml file:

language: java
sudo: false

matrix:
 include:
  - os: linux
    jdk: oraclejdk8
script: ./build.sh
cache:
 directories:
  - $HOME/.m2

And build.sh

#!/bin/bash
set -ev
cd Code/Java/DBServer
mvn clean install

Location of pom.xml is Code/Java/DBServer/pom.xml

How to make Travis build with Maven?

My guess is that travis is using a default Ant build for the install phase.

I'd try blanking out the install phase of travis with a .travis.yml like this:

language: java
sudo: false
os: linux
jdk: oraclejdk8
install: 
script: ./build.sh
cache:
 directories:
  - $HOME/.m2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM