title: java mixed with clojure in maven and eclipse
body: <p>i created a sample polyglot program. i have a sensor and a robot implemented in java and AI implemented in clojure. and i can't connect maven properly</p>
  
  <pre class="lang-none prettyprint-override"><code>--src/main/java/clojuretest
                            |
                             DistanceSensor.java
                             AI.clj       (uses DistanceSensor)
                             Robot.java   (uses AI)
  </code></pre>
  
  <p>DistanceSensor.java:</p>
  
  <pre class="lang-java prettyprint-override"><code>package clojuretest;
  
  public class DistanceSensor {
  
      public int getValue() {return 5;}
  }
  </code></pre>
  
  <p>AI.clj:</p>
  
  <pre class="lang-lisp prettyprint-override"><code>(ns clojuretest.AI
    (:gen-class :methods [[isObstacleAhead [] boolean]]))
  
  (defn -isObstacleAhead [this] (&lt; (.getValue (clojuretest.DistanceSensor.)) 10))
  </code></pre>
  
  <p>Robot.java:</p>
  
  <pre class="lang-java prettyprint-override"><code>package clojuretest;
  
  public class Robot {
  
      public boolean shouldStop() {
          return new AI().isObstacleAhead();
      }
  }
  </code></pre>
  
  <p>i can even manually force maven to compile it:
  <code>mvn clean clojure:compile</code> produces error - no DistanceSensor class (but for some reason creates AI.class). so then
  <code>mvn compile</code> sees AI.class and compiles everything correctly and tests pass. but what can i do to make <code>mvn clean compile</code> pass? how should my pom.xml look like? also what can i do to make eclipse stop complaining about non existing AI.class?</p>