logo maven-scala-plugin

The maven-scala-plugin is used for compiling/testing/running/documenting scala code in maven.

homepage: scala-tools.org/mvnsites/maven-scala-plugin
fresh index:
last release: 1 decade ago, first release: 1 decade ago
packaging: maven-plugin
get this artifact from: central
see this artifact on: search.maven.org


Display vulnerabilities (snyk): Vulnerability check

This chart shows how much is this artifact used as a dependency in other Maven artifacts in Central repository and GitHub:


select version:

Add this snippet into pom.xml inside tag <project><build><plugins>:




Switch to artifact.
goals:
scala:run

Run a Scala class using the Scala runtime

scala:script

Run a scala script.

scala:cctest

Compile the main and test scala source directory then run unit test cases in continuous (infinite loop). This is an util goal for commandline usage only (Do not use or call it in a pom) !!!

scala:compile (phase: compile)

Compiles a directory of Scala source. Corresponds roughly to the compile goal of the maven-compiler-plugin

scala:cc

Compile the main and test scala source directory in continuous (infinite loop). !! This is an util goal for commandline usage only (Do not use or call it in a pom) !!!

scala:cs-stop

Request compile to ScalaCS (no more, doesn't create project, check if exist,...)

scala:cs-compile-all

Request compile to ScalaCS (no more, doesn't create project, check if exist, request compile of dependencies,...)

scala:genjson

Produces Scala API documentation in Json (use vscaladoc2_genjson).

scala:add-source (phase: initialize)

Add more source directories to the POM.

scala:cs-remove

Request compile to ScalaCS (no more, doesn't create project, check if exist, request compile of dependencies,...)

scala:testCompile (phase: test-compile)

Compile Scala test source into test-classes. Corresponds roughly to testCompile in maven-compiler-plugin

scala:cs-init

Register the current project into running ScalaCS. If there is no running ScalaCS then install (if needed) and start it.

scala:console

Run the Scala console with all the classes of the projects (dependencies and builded)

scala:help

Display the Scala Compiler help

scala:cs-compile

Request compile to ScalaCS (no more, doesn't create project, check if exist, request compile of dependencies,...)

scala:cs-compile-single

Request compile to ScalaCS (no more, doesn't create project, check if exist,...), but only the current project

scala:doc

Produces Scala API documentation.

Often used code snippets:

<plugin>
  <groupId>org.scala-tools</groupId>
  <artifactId>maven-scala-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>testCompile</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <scalaVersion>${scala.version}</scalaVersion>
    <args>
      <arg>-target:jvm-1.5</arg>
    </args>
  </configuration>
</plugin>
<plugin>
  <groupId>org.scala-tools</groupId>
  <artifactId>maven-scala-plugin</artifactId>
  <version>2.15.2</version>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>testCompile</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.scala-tools</groupId>
  <artifactId>maven-scala-plugin</artifactId>
  <executions>
    <execution>
      <id>compile</id>
      <goals>
        <goal>compile</goal>
      </goals>
      <phase>compile</phase>
    </execution>
    <execution>
      <id>test-compile</id>
      <goals>
        <goal>testCompile</goal>
      </goals>
      <phase>test-compile</phase>
    </execution>
    <execution>
      <phase>process-resources</phase>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.scala-tools</groupId>
  <artifactId>maven-scala-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>testCompile</goal>
      </goals>
    </execution>
  </executions>
</plugin>
<plugin>
  <groupId>org.scala-tools</groupId>
  <artifactId>maven-scala-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>testCompile</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <scalaVersion>${scala.version}</scalaVersion>
  </configuration>
</plugin>

© Jiri Pinkas 2015 - 2022. All rights reserved! Admin login To submit bugs / feature requests please use this github page
related: JavaVids | Top Java Blogs | Java školení
Apache and Apache Maven are trademarks of the Apache Software Foundation. The Central Repository is a service mark of Sonatype, Inc.