scala:script

Full name:

org.scala-tools:maven-scala-plugin:2.9.1:script

Description:

Run a scala script.

Attributes:

  • Requires a Maven 2.0 project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Since version: 2.7.

Required Parameters

Name Type Since Description
displayCmd boolean 2.7 Display the command line called ? Default value is: false.
includeScopes String 2.7 Comma separated list of scopes to add to the classpath. Eg: test,compile Default value is: compile, test, runtime.
scalaClassName String 2.7 className (FQN) of the scala tool to provide as Default value is: scala.tools.nsc.Main.

Optional Parameters

Name Type Since Description
addToClasspath String 2.7 Comma seperated list of directories or jars to add to the classpath
args String[] 2.7 compiler additionnals arguments
dependencies BasicArtifact[] 2.7 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>
excludeScopes String 2.7 Comma separated list of scopes to remove from the classpath. Eg: test,compile
jvmArgs String[] 2.7 Jvm Arguments.
keepGeneratedScript boolean 2.7 If set to true the Scala classfile that is generated will not be deleted after the goal completes. This is to allows easier debugging of the script especially since line numbers will be wrong because lines are added to the compiled script (see script examples) Default value is: false.
outputDir File 2.7 The build directory of the project
removeFromClasspath String 2.7 Comma separated list of directories or jars to remove from the classpath. This is useful for resolving conflicts in the classpath. For example, the script uses Ant 1.7 and the compiler dependencies pull in Ant 1.5 optional which conflicts and causes a crash
scalaVersion String 2.7 Scala 's version to use
script String 2.7 The script that will be executed. Either 'scriptFile' or ' script' must be defined.
scriptFile File 2.7 The file containing script to be executed. Either 'scriptFile' or 'script' must be defined.

Parameter Details

addToClasspath:

Comma seperated list of directories or jars to add to the classpath
  • Type: java.lang.String
  • Since: 2.7
  • Required: No
  • Expression: ${addToClasspath}

args:

compiler additionnals arguments
  • Type: java.lang.String[]
  • Since: 2.7
  • 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: org.scala_tools.maven.BasicArtifact[]
  • Since: 2.7
  • Required: No

displayCmd:

Display the command line called ?
  • Type: boolean
  • Since: 2.7
  • Required: Yes
  • Expression: ${maven.scala.displayCmd}
  • Default: false

excludeScopes:

Comma separated list of scopes to remove from the classpath. Eg: test,compile
  • Type: java.lang.String
  • Since: 2.7
  • Required: No
  • Expression: ${maven.scala.excludeScopes}

includeScopes:

Comma separated list of scopes to add to the classpath. Eg: test,compile
  • Type: java.lang.String
  • Since: 2.7
  • Required: Yes
  • Expression: ${maven.scala.includeScopes}
  • Default: compile, test, runtime

jvmArgs:

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

keepGeneratedScript:

If set to true the Scala classfile that is generated will not be deleted after the goal completes. This is to allows easier debugging of the script especially since line numbers will be wrong because lines are added to the compiled script (see script examples)
  • Type: boolean
  • Since: 2.7
  • Required: No
  • Expression: ${maven.scala.keepGeneratedScript}
  • Default: false

outputDir:

The build directory of the project
  • Type: java.io.File
  • Since: 2.7
  • Required: No
  • Expression: ${project.build.directory}

removeFromClasspath:

Comma separated list of directories or jars to remove from the classpath. This is useful for resolving conflicts in the classpath. For example, the script uses Ant 1.7 and the compiler dependencies pull in Ant 1.5 optional which conflicts and causes a crash
  • Type: java.lang.String
  • Since: 2.7
  • Required: No
  • Expression: ${removeFromClasspath}

scalaClassName:

className (FQN) of the scala tool to provide as
  • Type: java.lang.String
  • Since: 2.7
  • Required: Yes
  • Expression: ${maven.scala.className}
  • Default: scala.tools.nsc.Main

scalaVersion:

Scala 's version to use
  • Type: java.lang.String
  • Since: 2.7
  • Required: No
  • Expression: ${maven.scala.version}

script:

The script that will be executed. Either 'scriptFile' or ' script' must be defined.
  • Type: java.lang.String
  • Since: 2.7
  • Required: No
  • Expression: ${script}

scriptFile:

The file containing script to be executed. Either 'scriptFile' or 'script' must be defined.
  • Type: java.io.File
  • Since: 2.7
  • Required: No
  • Expression: ${scriptFile}