Here's one way of brute-force converting a bunch of Java code to Scala without too much concern for correctness.
Hard stuff is done by scalagen
.
If the project is Maven-based with an existing pom.xml
, all you need to do is run the scalagen
Maven plugin:
mvn com.mysema.scalagen:scalagen-maven-plugin_2.10.1:0.3.2:main -DtargetFolder=target/scala
You have to have a pom.xml
file for this to work. If your project is configured with sbt (or have no project!), use the sbt makePom
task to create one:
sbt makePom
...
cp target/scala-2.10/*.pom pom.xml # Or whatever your scala version is
mvn com.mysema.scalagen:scalagen-maven-plugin_2.10.1:0.3.2:main -DtargetFolder=target/scala