harrah/xsbt — Issue #287: add a maven mode for using sbt on existing maven projects
Author: jstrachan
Created: 2011-12-02 13:49:43+00:00
State: open

There's a ton of maven projects out there; e.g. pretty much all JVM based stuff at apache & codehaus uses maven for example.

Asking/waiting for folks to rewrite their entire builds in SBT is not gonna happen any time soon. If you want SBT to gain world domination sooner (you may not care :) you could do the following...

* support a 'maven mode' for sbt. Just like the latest SBT can boot up with little/no configuration; if there's no sbt configuration at all but there is a pom.xml, auto-detect it and boot up SBT in 'maven mode'.

* this would auto-create a little bootstrap sbt configuration file if it doesn't exist already - which turns on maven-mode (and could later on get tweaked)

* maven-mode would just read the pom.xml files using Aether (not Ivy!) for faithful resolving of all the maven metadata, multi-module dependency trees & properties & profiles etc; then use SBT for the actual tasks of compiling & running tests. e.g. see [maven-sbt](https://github.com/rossabaker/maven-sbt)

## Benefits

You instantly get a ton more prospective users. Its now a no brainer to start using SBT as a build tool on mvn projects. You can then hook maven users with your cool SBT incremental compile crack & give them fast compiles on scala.

Over time folks might even migrate away from the mvn build & mvn plugins to SBT. But its zero risk. So folks could keep their mvn builds for things like releasing; but use SBT for day to day stuff. Or keep both builds in parallel for a while until folks build up enough trust in SBT (or when SBT gets to 1.0 or something :)

Today asking folks to totally replace their maven build is a pretty big ask - particularly if the maven build is already done and works fine mostly. Without maven-mode, there's a huge barrier to adoption for projects which already exist & use maven; most folks have better things to do with their time than re-write build configurations :) However using maven-mode - which would be pretty simple and quick to create I'd have thought - it'd be a no brainer for folks to dip their toes into SBT & they could get hooked :). Bwahahahaha.... :)