Apache Maven Scripting Plugin
Usage
This plugin contains generic code to evaluate any script that supports JSR223. It is a matter of adding the right dependency and configure the script to evaluate.
Inline script
Use the script-tag to specify your script. Make sure you also define the engineName.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scripting-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<engineName>groovy</engineName>
<script>
<![CDATA[
// your groovy script
]]>
</script>
</configuration>
<dependencies>
<!-- ScriptEngines -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>2.4.7</version>
</dependency>
</dependencies>
</plugin>
Script from File
Use the scriptFile-tag to refer to your script. The engine is based on the file-extension, but can be specified using the engineName-tag.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scripting-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<scriptFile>path/to/script.groovy</scriptFile>
</configuration>
<dependencies>
<!-- ScriptEngines -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>2.4.7</version>
</dependency>
</dependencies>
</plugin>
Script from File
Use the scriptResource-tag to refer to your script and include its artifact as a dependency to the plugin. The engine is based on the resource-extension, but can be specified using the engineName-tag.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scripting-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<scriptResource>/com/foo/bar/script.groovy</scriptFile>
</configuration>
<dependencies>
<!-- Shared Resource -->
<dependency>
<groupId/>
<artifactId/>
<version/>
</dependency>
<!-- ScriptEngines -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>2.4.7</version>
</dependency>
</dependencies>
</plugin>



