views:

977

answers:

2

As you know, SBT is compatible with Maven in some way -- SBT recognizes simple Maven POMs and can use dependencies and repositories specified in them. However, SBT wiki says that, if inline dependency is specified in SBT project definition, POM will be ignored (so using both in this case is impossible):

Maven and Ivy configurations (pom.xml and ivy.xml) are ignored when inline dependency declarations are present.

Does anyone know, if any kind of converter from Maven POM to SBT project definition exists (translating POM's XML into project definition Scala code)? I'm considering writing such script (that will help to migrate my old Scala/Maven projects to SBT), but want to know first, if this functionality already exists.

+6  A: 

Converter is far too strong a term for this hack, but I wrote a script to take a block of and output SBT style deps: http://gist.github.com/388334

retronym
@retronym Nice hack! I was thinking about this kind of stuff (+ conversion of properties and repos).
Vasil Remeniuk
+4  A: 

I didn't manage to find an undocumented capability in SBT that allows to make such conversions (POM -> project definition), and have came up with writing a very simple script that creates SBT build file with repos/dependencies from POM.

In case you just need to convert Maven/XML dependencies into SBT/Scala, you can use this script provided by @retronym

Vasil Remeniuk