Reputation: 117
Git repository:- xyz/repository
Project:- xyz/repository/project/pom.xml
.travis.yml: [kept in /project]
language: java
script: mvn clean install
Travis CI always executes the script in xyz/repository I tried with below
language: java
script: cd project
mvn clean install
But it still executes in xyz/repository
Error: The goal you specified requires a project to execute but there is no POM in this directory
Could someone please help?
Upvotes: 4
Views: 1006
Reputation: 464
Create a bash script with simple cd commands before maven clean install. Then reference your bash script in .travis
build.sh :
cd git_repo/
mvn clean install
.travis.yml :
script: ./build.sh
Upvotes: 3
Reputation: 117
Got it working.
Corrected the yml format.
language: java
script:
- cd project
- mvn clean install
The above works.
Upvotes: 5