Reputation: 10352
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.
Upvotes: 7
Views: 2180
Reputation: 937
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
Upvotes: 10
Reputation: 22105
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.
Upvotes: 4