I think that the problem is that travis-ci checks at the very start of the build if there is a pom.xml
file, before even before_install
. The good news is though that you can set you own script to run. Add script: mvn test
to your .travis.yml
file(Or whatever other maven command you want use to run your tests).
Travis-CI tries to start rake starting while pom.xml is available in directory
-
18-06-2023 - |
Pregunta
I'm trying to build my Java project with Travis-CI.
The project which I'm trying to build is in a subdirectory in my repository. Because of this I've added a "cd" command to goto the directory and a "ls" command to verify that the correct directory opened.
What I see in the log that correct directory is opened and that the pom.xml is available. What i would suspect is that Maven is started. That is not the case. Rake is started. What I'am not seeing?
The .travis.yml file:
language: java
before_install:
- cd Back-end
- ls
jdk:
- oraclejdk8
The log file:
$ bundle --version
Bundler version 1.5.3
Applying fix for NPM certificates
before_install.1
$ cd Back-end
before_install.2
$ ls
pom.xml Procfile src system.properties
$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/home/travis/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
The command "rake" exited with 1.
Done. Your build exited with 1.
Thanks in advance!
Solución
Otros consejos
Might be that this is outdated now. It seems that Travis functionality has changed. If you choose "More Options > Trigger build" you will get to a CUSTOM build dialog. It will ignore your travis.yml file in the Git repository. To run a manual build one must copy content of travis.yml
file and paste it in the dialog's "Custom config" field.