public class MavenBuilderPluginImpl extends ModulePluginAbstractImpl implements org.azyva.dragom.model.plugin.BuilderPlugin
BuilderPlugin that supports Maven.
This plugin uses many properties to build the command line for invoking Maven.
Although many such properties are generally expected to be defined at the
Model level, most, if not all, of them can be overridden at many levels
so they are accessed as runtime properties using
RuntimePropertiesPlugin.
Also, many properties can also be overridden by Module instances checked
out from the SCM, allowing the definition of Module's, including how to build
them, to be self-contained. Such properties are read from an optional
dragom.properties file at the root of the workspace directory for for the
Module.
This implementation interprets the build context passed to the build(java.nio.file.Path, java.lang.String, java.io.Writer)
method as a comma-separated list of Maven profiles that are passed to Maven.
These profiles are combined with those specified by the MAVEN_PROFILES runtime
property.
This implementation does not support user input during the build process.
| Constructor and Description |
|---|
MavenBuilderPluginImpl(org.azyva.dragom.model.Module module)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
build(Path pathModuleWorkspace,
String buildContext,
Writer writerLog) |
boolean |
clean(Path pathModuleWorkspace,
Writer writerLog) |
boolean |
invokeMaven(Path pathModuleWorkspace,
String buildContext,
Writer writerLog,
boolean indCleanOnly)
Main method that invokes Maven either for building or cleaning.
|
boolean |
isCleanSupported() |
boolean |
isSomethingToBuild(Path pathModuleWorkspace) |
boolean |
isSomethingToClean(Path pathModuleWorkspace) |
getModule, toStringgetNodepublic MavenBuilderPluginImpl(org.azyva.dragom.model.Module module)
This constructor is trivial since all properties are accessed as runtime properties.
module - Module.public boolean isSomethingToBuild(Path pathModuleWorkspace)
isSomethingToBuild in interface org.azyva.dragom.model.plugin.BuilderPluginpublic boolean build(Path pathModuleWorkspace, String buildContext, Writer writerLog)
build in interface org.azyva.dragom.model.plugin.BuilderPluginpublic boolean isCleanSupported()
isCleanSupported in interface org.azyva.dragom.model.plugin.BuilderPluginpublic boolean isSomethingToClean(Path pathModuleWorkspace)
isSomethingToClean in interface org.azyva.dragom.model.plugin.BuilderPluginpublic boolean clean(Path pathModuleWorkspace, Writer writerLog)
clean in interface org.azyva.dragom.model.plugin.BuilderPluginpublic boolean invokeMaven(Path pathModuleWorkspace, String buildContext, Writer writerLog, boolean indCleanOnly)
For we invoke Maven in nearly the same way given the runtime properties, whether we are building or cleaning, hence the factoring of the code in a single method.
pathModuleWorkspace - Path to the Module within the workspace.buildContext - Build context.writerLog - Writer where the log of the build or clean process can be
written. Can be null if the caller is not interested in the log.indCleanOnly - Indicates to clean only.Copyright © 2015–2016 AZYVA INC.. All rights reserved.