How to use scala.js from maven

Is it possible to use scala.js with Maven. I want to use scala.js in a maven and AFAIU based project, it is difficult to integrate sbt with maven.

+7
maven
source share
2 answers

1) scalor-maven-plugin provides scala.js support

2) global remote shared parent pom.xml with scala.js profiles

3) examples maven profiles that configure scala.js and scala.js runtime projects

+7
source share

Unfortunately, this is not yet possible, as the Maven plugin does not allow Scala.js.

Scala.js consists of several things:

  • A compiler plugin for scalac, which can be included with the Maven plugin for Scala .
  • Libraries: scalajs-library and optionally scalajs-javalibex .
  • Link-time tools: they are displayed directly in the sbt plugin, although its core is located in a separate scalajs-tools library, which can be reused by the Maven plugin for Scala.js.

As with Scala.js 0.6.0, all these things are published on Maven Central, so Maven can solve them. (Except for the sbt plugin with specific sbt nodes, but this is not necessary.)

While no one is developing a proper Maven plugin for Scala.js, calling Scala's command line interface can be the easiest . js from Maven to call connection-time tools (specifically scalajsld ). I do not know Maven, but I assume that it has tasks for invoking external command-line programs in its pipeline.

Edit: Updated for Scala.js 0.6.x: artifacts are now published on Maven Central.

+5
source share

All Articles