scala:cctest

Full name:

net.alchim31.maven:scala-maven-plugin:4.8.1:cctest

Description:

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

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is not marked as thread-safe and thus does not support parallel builds.

Required Parameters

Name Type Since Description
<displayCmd> boolean - Display the command line called ? (property 'maven.scala.displayCmd' replaced by 'displayCmd')
Default value is: false.
User property is: displayCmd.

Optional Parameters

Name Type Since Description
<additionalDependencies> Dependency[] - Additional dependencies to be added to the classpath. This can be useful in situations where a dependency is needed at compile time, but should not be treated as a dependency in the published POM.
User property is: additionalDependencies.
<addJavacArgs> String - Alternative method for specifying javac arguments (when using incremental compiler). Can be used from command line with -DaddJavacArgs=arg1|arg2|arg3|... rather than in pom.xml.
User property is: addJavacArgs.
<addScalacArgs> String - Additional parameter to use to call the main class. Use this parameter only from command line ("-DaddScalacArgs=arg1|arg2|arg3|..."), not from pom.xml. To define compiler arguments in pom.xml see the "args" parameter.
User property is: addScalacArgs.
<analysisCacheFile> File - Analysis cache file for incremental recompilation.

Note: Allows extending for 3rd-party usages


Default value is: ${project.build.directory}/analysis/compile.
User property is: analysisCacheFile.
<args> String[] - compiler additional arguments
<ccTestGoals> String - A space-separated list of the goals to execute as part of running the tests. You can use this setting to run different testing tools other than just JUnit. For example, to run the ScalaTest (with the maven-scalatest-plugin):
  mvn -Dcctest.goals=scalatest:test scala:cctest
To run both ScalaTest and JUnit tests:
  mvn -Dcctest.goals="surefire:test scalatest:test" scala:cctest
If you need to specify the goal every time you run scala:cctest, you can configure the setting in the pom.xml:
   <plugin>
      <groupId>net.alchim31.maven</groupId>
      <artifactId>scala-maven-plugin</artifactId>
      <version>2.16.0</version>
      <configuration>
         <ccTestGoals>scalatest:test</ccTestGoals>
      </configuration>
      <!-- normal executions here -->
   </plugin>

Default value is: surefire:test.
User property is: cctest.goals.
<checkMultipleScalaVersions> boolean - Check if every dependencies use the same version of scala-library or scala.compat.version.
Default value is: true.
User property is: maven.scala.checkConsistency.
<compileOrder> CompileOrder - Compile order for Scala and Java sources for sbt incremental compile.

Can be Mixed, JavaThenScala, or ScalaThenJava.


Default value is: Mixed.
User property is: compileOrder.
<compilerPlugins> BasicArtifact[] - Compiler plugin dependencies to use when compiling. ex:
<compilerPlugins>
  <compilerPlugin>
    <groupId>my.scala.plugin</groupId>
    <artifactId>amazingPlugin</artifactId>
    <version>1.0-SNAPSHOT</version>
  </compilerPlugin>
</compilerPlugins>

<dependencies> BasicArtifact[] - Additional dependencies/jar to add to classpath to run "scalaClassName" (scope and optional field not supported) ex :
   <dependencies>
     <dependency>
       <groupId>org.scala-tools</groupId>
       <artifactId>scala-compiler-addon</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
   </dependencies>

<encoding> String - The -encoding argument for the Java compiler. (when using incremental compiler).
Default value is: UTF-8.
User property is: project.build.sourceEncoding.
<excludes> Set<String> - A list of exclusion filters for the compiler. ex :
   <excludes>
     <exclude>SomeBadFile.scala</exclude>
   </excludes>

<failOnMultipleScalaVersions> boolean - Determines if a detection of multiple scala versions in the dependencies will cause the build to fail.
Default value is: false.
<forceUseArgFile> boolean - Force the use of an external ArgFile to run any forked process.
Default value is: false.
<fork> boolean - Forks the execution of scalac into a separate process.
Default value is: true.
<includes> Set<String> - A list of inclusion filters for the compiler. ex :
   <includes>
     <include>SomeFile.scala</include>
   </includes>

<javacArgs> String[] - Arguments for javac (when using incremental compiler).
User property is: javacArgs.
<javacGenerateDebugSymbols> boolean - Whether to instruct javac to generate debug symbols (when using incremental compiler)
See also: ://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug
Default value is: true.
User property is: javacGenerateDebugSymbols.
<jvmArgs> String[] - Jvm Arguments.
<localRepositoryPath> File - The local repository for caching artifacts. It is strongly recommended to specify a path to an isolated repository like ${project.build.directory}/it-repo. Otherwise, your ordinary local repository will be used, potentially soiling it with broken artifacts.
Default value is: ${settings.localRepository}.
User property is: invoker.localRepositoryPath.
<mainOutputDir> File - The output directory for compilation.
User property is: project.build.outputDirectory.
<mainSourceDir> File - The main directory containing scala source for compilation

Note: Allows extending for 3rd-party usages


Default value is: ${project.build.sourceDirectory}/../scala.
<notifyCompilation> boolean - notifyCompilation if true then print a message "path: compiling" for each root directory or files that will be compiled. Useful for debug, and for integration with Editor/IDE to reset markers only for compiled files.
Default value is: true.
User property is: notifyCompilation.
<once> boolean - Define if cc should run once or in infinite loop. (useful for test or working with editor)

Note: Allows extending for 3rd-party usages


Default value is: false.
User property is: once.
<pluginArtifacts> List<Artifact> - List of artifacts to run plugin
Default value is: ${plugin.artifacts}.
<recompileMode> ScalaCompilerSupport$RecompileMode - Recompile mode to use when sources were previously compiled and there is at least one change, see RecompileMode.
Default value is: incremental.
User property is: recompileMode.
<release> String - The --release argument for the Java compiler (when using incremental compiler), supported since Java9.
User property is: maven.compiler.release.
<scalaClassName> String - override the className (FQN) of the scala tool
User property is: maven.scala.className.
<scalaCompatVersion> String - Scala 's version to use to check binary compatibility (like suffix in artifactId of dependency). If it is defined then it is used to checkMultipleScalaVersions
User property is: scala.compat.version.
<scalaHome> String - Path to Scala installation to use instead of the artifact (define as dependencies).
User property is: scala.home.
<scalaOrganization> String - Organization/group ID of the Scala used in the project. Default value is 'org.scala-lang'. This is an advanced setting used for clones of the Scala Language. It should be disregarded in standard use cases.
Default value is: org.scala-lang.
User property is: scala.organization.
<scalaVersion> String - Scala 's version to use. (property 'maven.scala.version' replaced by 'scala.version')
User property is: scala.version.
<secondaryCacheDir> File - Location of the incremental compile will install compiled compiler bridge jars. Default is sbt's "~/.sbt/1.0/zinc/org.scala-sbt".
User property is: secondaryCacheDir.
<sendJavaToScalac> boolean - Enables/Disables sending java source to the scala compiler.
Default value is: true.
<source> String - The -source argument for the Java compiler (when using incremental compiler).
User property is: maven.compiler.source.
<target> String - The -target argument for the Java compiler (when using incremental compiler).
User property is: maven.compiler.target.
<test> String - Specify this parameter to run individual tests by file name, overriding the includes/excludes parameters. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.java, so you can just type "-Dtest=MyTest" to run a single test called "foo/MyTest.java". This parameter will override the TestNG suiteXmlFiles parameter.
User property is: test.
<testAnalysisCacheFile> File - Analysis cache file for incremental recompilation.

Note: Allows extending for 3rd-party usages


Default value is: ${project.build.directory}/analysis/test-compile.
User property is: testAnalysisCacheFile.
<testOutputDir> File - The directory to place test compilation output in

Note: Allows extending for 3rd-party usages


Default value is: ${project.build.testOutputDirectory}.
<testSourceDir> File - The directory containing test source for compilation

Note: Allows extending for 3rd-party usages


Default value is: ${project.build.testSourceDirectory}/../scala.
<useCanonicalPath> boolean - Should use CanonicalPath to normalize path (true => getCanonicalPath, false => getAbsolutePath)
See also: https://github.com/davidB/scala-maven-plugin/issues/50
Default value is: true.
User property is: maven.scala.useCanonicalPath.
<useFsc> boolean - Define if fsc should be used, else scalac is used. fsc => scala.tools.nsc.CompileClient, scalac => scala.tools.nsc.Main.

Note: Allows extending for 3rd-party usages


Default value is: true.
User property is: fsc.
<verbose> boolean - Turns verbose output on.

Note: Allows extending for 3rd-party usages


Default value is: false.
User property is: verbose.

Parameter Details

<additionalDependencies>

Additional dependencies to be added to the classpath. This can be useful in situations where a dependency is needed at compile time, but should not be treated as a dependency in the published POM.
  • Type: org.apache.maven.model.Dependency[]
  • Required: No
  • User Property: additionalDependencies

<addJavacArgs>

Alternative method for specifying javac arguments (when using incremental compiler). Can be used from command line with -DaddJavacArgs=arg1|arg2|arg3|... rather than in pom.xml.
  • Type: java.lang.String
  • Required: No
  • User Property: addJavacArgs

<addScalacArgs>

Additional parameter to use to call the main class. Use this parameter only from command line ("-DaddScalacArgs=arg1|arg2|arg3|..."), not from pom.xml. To define compiler arguments in pom.xml see the "args" parameter.
  • Type: java.lang.String
  • Required: No
  • User Property: addScalacArgs

<analysisCacheFile>

Analysis cache file for incremental recompilation.

Note: Allows extending for 3rd-party usages

  • Type: java.io.File
  • Required: No
  • User Property: analysisCacheFile
  • Default: ${project.build.directory}/analysis/compile

<args>

compiler additional arguments
  • Type: java.lang.String[]
  • Required: No

<ccTestGoals>

A space-separated list of the goals to execute as part of running the tests. You can use this setting to run different testing tools other than just JUnit. For example, to run the ScalaTest (with the maven-scalatest-plugin):
  mvn -Dcctest.goals=scalatest:test scala:cctest
To run both ScalaTest and JUnit tests:
  mvn -Dcctest.goals="surefire:test scalatest:test" scala:cctest
If you need to specify the goal every time you run scala:cctest, you can configure the setting in the pom.xml:
   <plugin>
      <groupId>net.alchim31.maven</groupId>
      <artifactId>scala-maven-plugin</artifactId>
      <version>2.16.0</version>
      <configuration>
         <ccTestGoals>scalatest:test</ccTestGoals>
      </configuration>
      <!-- normal executions here -->
   </plugin>
  • Type: java.lang.String
  • Required: No
  • User Property: cctest.goals
  • Default: surefire:test

<checkMultipleScalaVersions>

Check if every dependencies use the same version of scala-library or scala.compat.version.
  • Type: boolean
  • Required: No
  • User Property: maven.scala.checkConsistency
  • Default: true

<compileOrder>

Compile order for Scala and Java sources for sbt incremental compile.

Can be Mixed, JavaThenScala, or ScalaThenJava.

  • Type: xsbti.compile.CompileOrder
  • Required: No
  • User Property: compileOrder
  • Default: Mixed

<compilerPlugins>

Compiler plugin dependencies to use when compiling. ex:
<compilerPlugins>
  <compilerPlugin>
    <groupId>my.scala.plugin</groupId>
    <artifactId>amazingPlugin</artifactId>
    <version>1.0-SNAPSHOT</version>
  </compilerPlugin>
</compilerPlugins>
  • Type: scala_maven.BasicArtifact[]
  • Required: No

<dependencies>

Additional dependencies/jar to add to classpath to run "scalaClassName" (scope and optional field not supported) ex :
   <dependencies>
     <dependency>
       <groupId>org.scala-tools</groupId>
       <artifactId>scala-compiler-addon</artifactId>
       <version>1.0-SNAPSHOT</version>
     </dependency>
   </dependencies>
  • Type: scala_maven.BasicArtifact[]
  • Required: No

<displayCmd>

Display the command line called ? (property 'maven.scala.displayCmd' replaced by 'displayCmd')
  • Type: boolean
  • Required: Yes
  • User Property: displayCmd
  • Default: false

<encoding>

The -encoding argument for the Java compiler. (when using incremental compiler).
  • Type: java.lang.String
  • Required: No
  • User Property: project.build.sourceEncoding
  • Default: UTF-8

<excludes>

A list of exclusion filters for the compiler. ex :
   <excludes>
     <exclude>SomeBadFile.scala</exclude>
   </excludes>
  • Type: java.util.Set<java.lang.String>
  • Required: No

<failOnMultipleScalaVersions>

Determines if a detection of multiple scala versions in the dependencies will cause the build to fail.
  • Type: boolean
  • Required: No
  • Default: false

<forceUseArgFile>

Force the use of an external ArgFile to run any forked process.
  • Type: boolean
  • Required: No
  • Default: false

<fork>

Forks the execution of scalac into a separate process.
  • Type: boolean
  • Required: No
  • Default: true

<includes>

A list of inclusion filters for the compiler. ex :
   <includes>
     <include>SomeFile.scala</include>
   </includes>
  • Type: java.util.Set<java.lang.String>
  • Required: No

<javacArgs>

Arguments for javac (when using incremental compiler).
  • Type: java.lang.String[]
  • Required: No
  • User Property: javacArgs

<javacGenerateDebugSymbols>

Whether to instruct javac to generate debug symbols (when using incremental compiler)
See also: ://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#debug
  • Type: boolean
  • Required: No
  • User Property: javacGenerateDebugSymbols
  • Default: true

<jvmArgs>

Jvm Arguments.
  • Type: java.lang.String[]
  • Required: No

<localRepositoryPath>

The local repository for caching artifacts. It is strongly recommended to specify a path to an isolated repository like ${project.build.directory}/it-repo. Otherwise, your ordinary local repository will be used, potentially soiling it with broken artifacts.
  • Type: java.io.File
  • Required: No
  • User Property: invoker.localRepositoryPath
  • Default: ${settings.localRepository}

<mainOutputDir>

The output directory for compilation.
  • Type: java.io.File
  • Required: No
  • User Property: project.build.outputDirectory

<mainSourceDir>

The main directory containing scala source for compilation

Note: Allows extending for 3rd-party usages

  • Type: java.io.File
  • Required: No
  • Default: ${project.build.sourceDirectory}/../scala

<notifyCompilation>

notifyCompilation if true then print a message "path: compiling" for each root directory or files that will be compiled. Useful for debug, and for integration with Editor/IDE to reset markers only for compiled files.
  • Type: boolean
  • Required: No
  • User Property: notifyCompilation
  • Default: true

<once>

Define if cc should run once or in infinite loop. (useful for test or working with editor)

Note: Allows extending for 3rd-party usages

  • Type: boolean
  • Required: No
  • User Property: once
  • Default: false

<pluginArtifacts>

List of artifacts to run plugin
  • Type: java.util.List<org.apache.maven.artifact.Artifact>
  • Required: No
  • Default: ${plugin.artifacts}

<recompileMode>

Recompile mode to use when sources were previously compiled and there is at least one change, see RecompileMode.
  • Type: scala_maven.ScalaCompilerSupport$RecompileMode
  • Required: No
  • User Property: recompileMode
  • Default: incremental

<release>

The --release argument for the Java compiler (when using incremental compiler), supported since Java9.
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.release

<scalaClassName>

override the className (FQN) of the scala tool
  • Type: java.lang.String
  • Required: No
  • User Property: maven.scala.className

<scalaCompatVersion>

Scala 's version to use to check binary compatibility (like suffix in artifactId of dependency). If it is defined then it is used to checkMultipleScalaVersions
  • Type: java.lang.String
  • Required: No
  • User Property: scala.compat.version

<scalaHome>

Path to Scala installation to use instead of the artifact (define as dependencies).
  • Type: java.lang.String
  • Required: No
  • User Property: scala.home

<scalaOrganization>

Organization/group ID of the Scala used in the project. Default value is 'org.scala-lang'. This is an advanced setting used for clones of the Scala Language. It should be disregarded in standard use cases.
  • Type: java.lang.String
  • Required: No
  • User Property: scala.organization
  • Default: org.scala-lang

<scalaVersion>

Scala 's version to use. (property 'maven.scala.version' replaced by 'scala.version')
  • Type: java.lang.String
  • Required: No
  • User Property: scala.version

<secondaryCacheDir>

Location of the incremental compile will install compiled compiler bridge jars. Default is sbt's "~/.sbt/1.0/zinc/org.scala-sbt".
  • Type: java.io.File
  • Required: No
  • User Property: secondaryCacheDir

<sendJavaToScalac>

Enables/Disables sending java source to the scala compiler.
  • Type: boolean
  • Required: No
  • Default: true

<source>

The -source argument for the Java compiler (when using incremental compiler).
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.source

<target>

The -target argument for the Java compiler (when using incremental compiler).
  • Type: java.lang.String
  • Required: No
  • User Property: maven.compiler.target

<test>

Specify this parameter to run individual tests by file name, overriding the includes/excludes parameters. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.java, so you can just type "-Dtest=MyTest" to run a single test called "foo/MyTest.java". This parameter will override the TestNG suiteXmlFiles parameter.
  • Type: java.lang.String
  • Required: No
  • User Property: test

<testAnalysisCacheFile>

Analysis cache file for incremental recompilation.

Note: Allows extending for 3rd-party usages

  • Type: java.io.File
  • Required: No
  • User Property: testAnalysisCacheFile
  • Default: ${project.build.directory}/analysis/test-compile

<testOutputDir>

The directory to place test compilation output in

Note: Allows extending for 3rd-party usages

  • Type: java.io.File
  • Required: No
  • Default: ${project.build.testOutputDirectory}

<testSourceDir>

The directory containing test source for compilation

Note: Allows extending for 3rd-party usages

  • Type: java.io.File
  • Required: No
  • Default: ${project.build.testSourceDirectory}/../scala

<useCanonicalPath>

Should use CanonicalPath to normalize path (true => getCanonicalPath, false => getAbsolutePath)
See also: https://github.com/davidB/scala-maven-plugin/issues/50
  • Type: boolean
  • Required: No
  • User Property: maven.scala.useCanonicalPath
  • Default: true

<useFsc>

Define if fsc should be used, else scalac is used. fsc => scala.tools.nsc.CompileClient, scalac => scala.tools.nsc.Main.

Note: Allows extending for 3rd-party usages

  • Type: boolean
  • Required: No
  • User Property: fsc
  • Default: true

<verbose>

Turns verbose output on.

Note: Allows extending for 3rd-party usages

  • Type: boolean
  • Required: No
  • User Property: verbose
  • Default: false