Available JSR223 Script Engines

EngineName Dependency
groovy <dependency>
  <groupId>org.codehaus.groovy</groupId>
  <artifactId>groovy-jsr223</artifactId>
  <version>…</version>
</dependency>
java built-in

The java engine enables to execute simple Java scripts.

It imports by default java.io, java.net, java.util, java.util.stream, java.nio.file.

It makes available the following contextual variables:

  • $log: maven logger
  • MavenProject: org.apache.maven.plugins:maven-scripting-plugin:3.1.0 @ /Users/slachiewicz/mvn4/plugins/tools/maven-scripting-plugin/target/checkout/pom.xml: maven project

The script is the content of a java method. Example:

$log.info($project.getArtifactId());