Skip to main content

Use maven2sbt as a Library

How to Use#

Get immediate result#

import java.io.File
import maven2sbt.core.Maven2Sbtimport maven2sbt.core.Propsimport maven2sbt.core.ScalaBinaryVersionimport maven2sbt.core.ScalaVersion
import cats._
Maven2Sbt[Id].buildSbtFromPomFile(  ScalaVersion("2.13.3"),  Props.PropsName("props"),  Some(ScalaBinaryVersion.Name("scalaBinaryVersion")), // or None  new File("/path/to/pom.xml"))// Id[Either[Maven2SbtError, BuildSbt]]
// or
Maven2Sbt[Id].buildSbtFromInputStream(  ScalaVersion("2.13.3"),  Props.PropsName("props"),  Some(ScalaBinaryVersion.Name("scalaBinaryVersion")), // or None  inputStream)// Id[Either[Maven2SbtError, BuildSbt]]

With Cats Effect#

import java.io.File
import maven2sbt.core.Maven2Sbtimport maven2sbt.core.Propsimport maven2sbt.core.ScalaBinaryVersionimport maven2sbt.core.ScalaVersion
import cats.effect._
Maven2Sbt[IO].buildSbtFromPomFile(  ScalaVersion("2.13.1"),  Props.PropsName("props"),  Some(ScalaBinaryVersion.Name("scalaBinaryVersion")), // or None  new File("/path/to/pom.xml"))// IO[Either[Maven2SbtError, BuildSbt]]
// or
Maven2Sbt[IO].buildSbtFromInputStream(  ScalaVersion("2.13.1"),  Props.PropsName("props"),  Some(ScalaBinaryVersion.Name("scalaBinaryVersion")), // or None  inputStream)// IO[Either[Maven2SbtError, BuildSbt]]