Scala Surefire Plugin

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

Categories

Categories

Scala Languages Maven Build Tools
GroupId

GroupId

com.vast
ArtifactId

ArtifactId

scala-surefire-maven-plugin
Last Version

Last Version

0.3.3
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Scala Surefire Plugin
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

Download scala-surefire-maven-plugin

How to add to project

<plugin>
    <groupId>com.vast</groupId>
    <artifactId>scala-surefire-maven-plugin</artifactId>
    <version>0.3.3</version>
</plugin>

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.maven.plugins : maven-surefire-plugin jar 2.16
org.codehaus.plexus : plexus-utils jar 3.0.10

provided (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.0
org.apache.maven : maven-core jar 3.0
org.apache.maven : maven-compat jar 3.0
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.2

test (2)

Group / Artifact Type Version
com.vast : surefire-scalatest19 jar 0.3.3
com.vast : surefire-scalatest20 jar 0.3.3

Project Modules

There are no modules declared in this project.

This is a set of useful tools for Maven and Scala.

scala-lifecycle-plugin

This is a plugin that adds a new packaging type ('scala-jar') to maven with a better default lifecycle. This lifecycle binds net.alchim31.maven:scala-maven-plugin:compile to the 'compile' phase by default while also retaining an invocation of maven-compiler-plugin. Additionally, com.vast:scala-surefire-maven-plugin:test is bound to the 'test' phase. This allows native and seamless use of ScalaTest in your build.

This project's releases are deployed to the maven central repository, so to use it, just add the following to the plugins section in your build.

<plugin>
    <groupId>com.vast</groupId>
    <artifactId>scala-lifecycle-plugin</artifactId>
    <version>3.2.0</version>
    <extensions>true</extensions>
</plugin>

Here's an example of a minimal POM that will compile all scala (and Java) in src/main/(scala|java) and run any JUnit or ScalaTest suites found in src/test/(scala|java). The key bit is the inclusion of the scala-lifecycle-plugin with extensions set to true. This tells Maven to use any lifecycles and/or custom packaging definitions it finds in the plugin.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.vast</groupId>
    <artifactId>simple-scala-project</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>scala-jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.10.3</version>
        </dependency>

        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.10</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
	<build>
		<plugins>
		    <plugin>
		        <groupId>com.vast</groupId>
		        <artifactId>scala-lifecycle-plugin</artifactId>
		        <version>3.2.0</version>
		        <extensions>true</extensions>
		    </plugin>
		</plugins>
	</build>
</project>

surefire-scala

This is a subclass of the maven-surefire-plugin that adds ScalaTest to the default list of 'known' test providers. If ScalaTest is detected in your test classpath, this provider will be used by default. As a bonus, this provider will also run any JUnit tests it finds in your build. The version of scala and ScalaTest is detected automatically from your build, assuming that there's a dependency to 'scala-library' somewhere in your test classpath.

The plugin is built with the intention of adding more Scala test providers to it eventually - right now, there is only support for ScalaTest (both 1.9.x and 2.0.x), but adding Specs would not be a difficult exercise.

Versions

Version
0.3.3
0.3.2
0.3.1
0.3.0
0.2.0
0.1.0