Skip to content

Instantly share code, notes, and snippets.

View cmobarry's full-sized avatar

Clark Mobarry cmobarry

  • 00:13 (UTC -04:00)
View GitHub Profile
@cmobarry
cmobarry / PomToSbt.scala
Created October 19, 2017 17:12 — forked from mslinn/PomToSbt.scala
Convert pom.xml to build.sbt
import scala.xml._
// To convert a Maven pom.xml to build.sbt:
// 1) Place this code into a file called PomToSbt.scala next to pom.xml
// 2) Type scala PomtoSbt.scala > build.sbt
// The dependencies from pom.xml will be extracted and place into a complete build.sbt file
// Because most pom.xml files only refernence non-Scala dependencies, I did not use %%
val lines = (XML.load("pom.xml") \\ "dependencies") \ "dependency" map { dependency =>
val groupId = (dependency \ "groupId").text
val artifactId = (dependency \ "artifactId").text