Answers: <p>The easiest method is to have Eclipse generate an Ant build script for you.</p>
  
  <p>Right click on your project in the Package Explorer and select <strong>Export</strong> in the context menu. Choose the export type <strong>General -> Ant Buildfiles</strong> and click <strong>Next</strong>.</p>
  
  <p><img src="https://i.sstatic.net/ssp3D.png" alt="Export menu screenshot"></p>
  
  <p>On the next screen, make sure your project is selected. You can keep leave the options on their default settings. Click <strong>Finish</strong> to generate your <code>build.xml</code> file.</p>
  
  <p><img src="https://i.sstatic.net/W0WDU.png" alt="Generate antfile dialog screenshot"></p>
  
  <p>Lastly, to ensure Travis CI runs the project correctly, <a href="https://docs.travis-ci.com/user/languages/java/" rel="noreferrer">create a .travis.yml in your project's root folder</a>. For Java projects, it should contain at least the following.</p>
  
  <pre><code>language: java
  jdk:
    - oraclejdk8
  
  script: ant build
  </code></pre>
  
  <p>Source: <a href="http://kofun.pl/various/using-trvis-ci-with-java-eclipse-project/" rel="noreferrer">Kofun devblog - Using Travis CI with Java Eclipse Project</a></p>
  
Answers: CC BY-SA 3.0
Answers: 2017-04-21T01:19:33.067Z
Answers: 2017-05-11T01:00:12.257Z
Answers: 2017-05-11T01:00:12.257Z
Answers: Stevoisiak
Body: <p>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.</p>
  
  <pre class="lang-none prettyprint-override"><code>Buildfile: build.xml does not exist!
  Build failed
  
  The command "ant test" exited with 1.
  </code></pre>
  
  <p>How do I configure Travis CI to run build tests for my Java Eclipse project?</p>
  
Tags: <travis-ci><github><eclipse>
Title: How do I configure Travis CI build testing for a Java Eclipse project?
UserDisplayName: Stevoisiak
ThreadText: # How do I configure Travis CI build testing for a Java Eclipse project?
  
  (Asked by: username_0 on 2017-04-21)
  
  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.
  
  ```none
  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?
  
  **Tags:** travis-ci, github, eclipse
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-04-21. Score: 10 | Accepted answer
  
  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**.
  
  ![Export menu screenshot](https://i.sstatic.net/ssp3D.png)
  
  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.
  
  ![Generate antfile dialog screenshot](https://i.sstatic.net/W0WDU.png)
  
  Lastly, to ensure Travis CI runs the project correctly, [create a .travis.yml in your project's root folder](https://docs.travis-ci.com/user/languages/java/). For Java projects, it should contain at least the following.
  
  ```
  language: java
  jdk:
    - oraclejdk8
  
  script: ant build
  
  ```
  
  Source: [Kofun devblog - Using Travis CI with Java Eclipse Project](http://kofun.pl/various/using-trvis-ci-with-java-eclipse-project/)
  
  
  ---
  
  