I am having trouble with running my Travis Ci. I am getting below error for my spring boot application.
0.01s$ java -Xmx32m -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
$ javac -J-Xmx32m -version
javac 11.0.2
3.37s$ ./gradlew assemble
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
The command "eval ./gradlew assemble " failed. Retrying, 2 of 3.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
The command "eval ./gradlew assemble " failed. Retrying, 3 of 3.
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
The command "eval ./gradlew assemble " failed 3 times.
The command "./gradlew assemble" failed and exited with 1 during .
Your build has been stopped.
.travis.yml
file
language: java
sudo: false
script: mvn clean verify
Let me know which files you need.
Alright, so the problem was that somehow my Spring-boot application has both Maven and Gradle files. I believe, while me experimenting different things, I generated Gradew file hence Travis CI was looking for Gradle.
Solution was to remove all the gradle files and re-run travis. I have updated my travis.yml as below
jdk:
- oraclejdk8
# would just use default install/script but the ./mvnw script errors on travis
# obviously this only works for maven builds right now...
install:
- mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- mvn cobertura:cobertura
script:
- mvn test
dist: trusty
after_success:
- bash <(curl -s https://codecov.io/bash) -t
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments