Two Scala Versions

Since 2.8.0-SNAPSHOT is giving me trouble in IDEA, but works fine in raw Maven, and also various tools are not working in 2.8, I want to maintain two versions of my project, for Scala 2.7.5 and Scala 2.8.0-SNAPSHOT.

One way to do it in Maven is with profiles, but I didn't explore it yet.  I compiled all dependencies with different versions: e.g., scala-json exists in Maven repository with versions 1.0-scala2.8.0-SNAPSHOT and 1.0-scala2.7.5.  The Scala version itself is defined by a property scala.version in the pom.xml.

I can see using inherited pom and setting the version separately; I can have the main pom in a top directory and two versions of the project in subdirectories...  May also use git branches.  Does IDEA have any way of its own to maintain such a dual version, and what would you recommend?


评论操作 固定链接

If you want to use language features or APIs new in 2.8 you would need to create branches with Git/SVN.

If you just want to compile 2.7.5 compatible code with 2.8-SNAPSHOT in Maven, Maven Profiles would be appropriate. Make the 2.7.x profile activeByDefault so that the IDEA import uses these libraries.