ppatierno ppatierno - 2 months ago 6x
Scala Question

IntelliJ IDEA : support both SBT and Maven on a single project

I already have a project in IntelliJ IDEA based on SBT. It works fine, compile and run. Now I want to add the Maven support as well.
How is it possible in IntelliJ IDEA having support for both build managers SBT and Maven in the same project and switch between them ?


In my experience you should have either maven or sbt enabled. Never both.

The solution:

  • checkout project from repository to project_sbt directory
  • open project in intellij as sbt project (just open project_sbt/build.sbt from disk)
  • checkout the same project from repository project to project_maven directory.
  • open project in intellij as maven project (just open project_maven/pom.xml from disk)

Disadvantages of this solution:

  • Changes in sbt project are not visible immediately in maven project (and vice versa)
  • You have to maintenance two build systems (special plugins)