snippetModerate
How do I configure Travis CI build testing for a Java Eclipse project?
Viewed 0 times
eclipsetravisjavaprojecttestingforhowbuildconfigure
Problem
I have an Eclipse Java project on GitHub. I would like to set up auto-build testing with Travis CI. However, when I enable build testing for my project, compilation always fails with the following error.
How do I configure Travis CI to run build tests for my Java Eclipse project?
Buildfile: build.xml does not exist!
Build failed
The command "ant test" exited with 1.
How do I configure Travis CI to run build tests for my Java Eclipse project?
Solution
The easiest method is to have Eclipse generate an Ant build script for you.
Right click on your project in the Package Explorer and select Export in the context menu. Choose the export type General -> Ant Buildfiles and click Next.
On the next screen, make sure your project is selected. You can keep leave the options on their default settings. Click Finish to generate your
Lastly, to ensure Travis CI runs the project correctly, create a .travis.yml in your project's root folder. For Java projects, it should contain at least the following.
Source: Kofun devblog - Using Travis CI with Java Eclipse Project
Right click on your project in the Package Explorer and select Export in the context menu. Choose the export type General -> Ant Buildfiles and click Next.
On the next screen, make sure your project is selected. You can keep leave the options on their default settings. Click Finish to generate your
build.xml file.Lastly, to ensure Travis CI runs the project correctly, create a .travis.yml in your project's root folder. For Java projects, it should contain at least the following.
language: java
jdk:
- oraclejdk8
script: ant buildSource: Kofun devblog - Using Travis CI with Java Eclipse Project
Code Snippets
language: java
jdk:
- oraclejdk8
script: ant buildContext
StackExchange DevOps Q#981, answer score: 10
Revisions (0)
No revisions yet.