MavenExecutionTemplate

The ExecutionTemplate which is created using the mvn execution builder function. This template class is used as a builder to construct the arguments to starts a Maven process.

Properties

Link copied to clipboard
abstract val ctx: ScopeContext

This field contains the context object that is applicable to the scope that defines the execution. The object is inherited directly from the parent net.democritus.scripting.scope.ScriptScope without alterations.

Functions

Link copied to clipboard
abstract fun file(value: Path)
abstract fun file(value: String)

Sets the path to POM file that Maven will execute. This path can be defined relative to the path in the current scope context at ScopeContext.path, but also as an absolute path.

Link copied to clipboard
abstract fun maxThreads()

Sets the number of threads for the Maven process to MAX_THREADS - 1, where MAX_THREADS is the maximum amount of threads available on the machine. One thread is subtracted to ensure that there's always one thread on the machine not being used by Maven, so it can be scheduled for other tasks.

Link copied to clipboard
abstract fun profile(value: String)

Adds a build profile to the Maven execution. A profile can also be explicitly excluded by prefixing it with ! or -.

Link copied to clipboard
abstract fun property(key: String, value: String)

Defines a property that will be passed to Maven when starting the execution. This is equivalent to using the -D parameter.

Link copied to clipboard
abstract fun task(value: String)

Defines a task that should be executed by Maven. A task in this context refers a lifecycle such as clean, a lifecycle phase such as package or a goal such as resources:testResources.

Link copied to clipboard
abstract fun threads(value: String)

Sets the number of threads that should be used by Maven to execute the requested task(s). This function takes a String value with the syntax required by Maven's -T argument. The function maxThreads can be used as an alternative to set this value.