I have configured a project to use scala/maven/Eclipse. Because I need a scala library on the build path and scalatest also uses its own scala library I receive this warning :
More than one scala library found in the build path, all with compatible versions. This is not an optimal configuration, try to limit to one scala library in the build path.
I don't think I can remove this warning as I need both libraries - one for Maven, the other for Eclipse. This doesn't seem to be causing any problems so will I just have to accept it? Is there an alternate configuration which uses just one scala library for Maven & Eclipse?
If I remove the scala library from the project I receive the error:
Cannot find Scala library on the classpath. Verify your build path!
For some reason Eclipse requires the scala library to be on the build path even though it is already available as a Maven dependency.
There is nothing to worry about. Eclipse warns you that you have several scala-library.jar
s on your classpath, but as long as they are the same version, it doesn't matter.
If one of them diverged (for instance, by bumping the Scala version number in your pom
file), you'd be in trouble: depending on the classpath order, the IDE will pick up classes from one or the other, and you might get different results when building on the command line.
Coming back to your setup, you could
Scala Library
classpath container from your Eclipse projects, leaving just the jar that maven adds.