Is there any way to use scala.js with Maven. I want to use scala.js in maven based project, and AFAIU, it's hard to integrate sbt with maven.
1) scalor-maven-plugin provides scala.js support
2) global remote shared parent pom.xml with scala.js profiles
3) gist examples of maven profiles which configure scala.js library and scala.js runtime projects
Unfortunately, this is not directly possible so far, because there is no Maven plugin enabling Scala.js.
Scala.js consists a few things:
scalajs-library
, and optionally scalajs-javalibex
.scalajs-tools
library, which could be reused by a Maven plugin for Scala.js.As of Scala.js 0.6.0, all these things are published on Maven Central, so can be resolved by Maven. (Except the sbt plugin with the sbt-specific parts, but that's not needed.)
As long as nobody actually develops a proper Maven plugin for Scala.js, the easiest might be to invoke the Command Line Interface of Scala.js from Maven to invoke the link-time tools (scalajsld
in particular). I don't know Maven, but I assume it has tasks to invoke external command-line programs in its pipeline.
Edit: Updated for Scala.js 0.6.x: artifacts are now published on Maven Central.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With