title: Package contains object and package with same name
body: <p>I am having problems compiling some Scala with Maven or Eclipse where I try to import a class from a Java jar which contains both a namespace and class of the same name.<br>
  I can compile with <code>scalac</code>, however.</p>
  
  <p>E.g. the Java project (jar) contains:</p>
  
  <pre><code>src/foo/bar.java
  
  src/foo/bar/some_resource.txt
  
  -&gt; foobar.jar
  
  Scala project references foobar.jar
  
  Foobartest.scala:
  
  import foo.bar
  
  class foobartest {
  
  }
  </code></pre>
  
  <p>The compiler complains with:</p>
  
  <pre><code>package foo contains object and package with same name: bar 
  one of them needs to be removed from classpath
  </code></pre>
  
  <p>Using Maven 3.0.03/Eclipse 3.7.1 with Scala 2.9.0.1 (and <code>maven-scala-plugin</code>).  </p>
  
  <p>The jar which I am having problems with is <code>jenkins-core-1.399.jar</code> - it definitely contains several instances where there is a namespace and object of the same name.<br>
  I am attempting to write a Jenkins plugin in Scala (I could do this in Java but would prefer scala since all of our libraries are in scala), which is dependent on using Maven -<br>
  <a href="https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial" rel="noreferrer">https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial</a>.</p>