Search code examples
eclipsemaven-2scalamaven-eclipse-plugin

Is there any way to avoid Scala libraries appearing twice in an Eclipse/Scala/Maven project?


I have

  • Eclipse 3.5.2
  • Scala 2.8.0 final (inc latest Scala IDE for Eclipse)
  • Maven integration for Eclipse
  • Maven 2.2.1
  • .project and .classpath files generated by maven-eclipse-plugin

I'm using Scala to write Specs BDD tests for my Java code and the setup above is working very nicely so far. However, I have one puzzling problem and I would like to know whether anyone knows how to resolve it.

The Scala libraries are appearing in my project twice.

  1. in the M2 ClassPath (as a Maven Dependency)
  2. as an Eclipse System Library (in the same manner as the JRE System Libraries)

Consequently, when I Ctrl-Shft-T every Scala class appears twice.

Can this be avoided without breaking my Scala project in either the command line or the Workspace?


Solution

  • To answer my own question,

    it appears (as hinted at by all above) that maven-eclipse-plugin is essentially obsolete. When I

    • deleted my old eclipse project
    • removed all eclipse files (ie .settings and .project from my project directory)
    • removed all references to maven-eclipse-plugin from my pom
    • installed the m2eclipse-scala plugin
    • re-imported the project as a maven project

    all settings were detected correctly and I no longer saw the double entry of scala classes in my classpath.