Package org.basepom.mojo.propertyhelper
Class AbstractPropertyHelperMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.basepom.mojo.propertyhelper.AbstractPropertyHelperMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,FieldContext
public abstract class AbstractPropertyHelperMojo
extends org.apache.maven.plugin.AbstractMojo
implements FieldContext
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidexecute()Returns the base dir for this maven build execution.Returns theInterpolatorFactorythat can interpolate "late resolution" properties.Returns a map with all known macros.org.apache.maven.project.MavenProjectReturns a reference to theMavenProject.Return the maven project properties.org.apache.maven.settings.SettingsReturns the current mavenSettingsobjectReturns a reference to theTransformerRegistry.voidsetActiveGroups(String... activeGroups) The property groups to activate.voidsetDates(DateDefinition... dateDefinitions) Date property definitions.voidsetMacroMap(Map<String, MacroType> macroMap) voidsetMacros(MacroDefinition... macroDefinitions) Macro definitions.voidsetNumbers(NumberDefinition... numberDefinitions) Number property definitions.voidsetOnDuplicateField(String onDuplicateField) Defines the action to take if a field is defined multiple times (e.g.voidsetPropertyGroups(PropertyGroupDefinition... propertyGroups) Define property groups.voidsetStrings(StringDefinition... stringDefinitions) String property definitions.voidsetUuids(UuidDefinition... uuidDefinitions) Uuid definitions.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
AbstractPropertyHelperMojo
public AbstractPropertyHelperMojo()
-
-
Method Details
-
setOnDuplicateField
@Parameter(defaultValue="fail", alias="onDuplicateProperty") public void setOnDuplicateField(String onDuplicateField) Defines the action to take if a field is defined multiple times (e.g. as a number and a string).
Options areignore- ignore multiple definitions silently, retain just the first one foundwarn- like ignore, but also log a warning messagefail- fail the build with an exception
-
setActiveGroups
The property groups to activate. If none are given, all property groups are activated.<activeGroups> <activeGroup>group1</activeGroup> <activeGroup>group2</activeGroup> ... </activeGroups> -
setPropertyGroups
Define property groups. A property group contains one or more property definitions. Property groups are active by default unless they are explicitly listed with<activeGroups>...</activeGroups.<propertyGroups> <propertyGroup> <id>...</id> <activeOnRelease>true|false</activeOnRelease> <activeOnSnapshot>true|false</activeOnSnapshot> <onDuplicateProperty>ignore|warn|fail</onDuplicateProperty> <onMissingField>ignore|warn|fail</onMissingField> <properties> <property> <name>...</name> <value>...</value> <transformers>...</transformers> </property> ... </properties> </propertyGroup> ... </propertyGroups> -
setNumbers
Number property definitions.<numbers> <number> <id>...</id> <skip>true|false</skip> <export>true|false</export> <fieldNumber>...</fieldNumber> <increment>...</increment> <format>...</format> <regexp>...</regexp> <transformers>...</transformers> <propertyFile>...</propertyFile> <propertyNameInFile>...</propertyNameInFile> <initialValue>...</initialValue> <onMissingFile>ignore|warn|fail|create</onMissingFile> <onMissingFileProperty>ignore|warn|fail|create</onMissingFileProperty> <onMissingProperty>ignore|warn|fail</onMissingProperty> </number> ... </numbers> -
setStrings
String property definitions.<strings> <string> <id>...</id> <skip>true|false</skip> <export>true|false</export> <values> <value>...</value> ... </values> <blankIsValid>true|false</blankIsValid> <onMissingValue>ignore|warn|fail</onMissingValue <format>...</format> <regexp>...</regexp> <transformers>...</transformers> <propertyFile>...</propertyFile> <propertyNameInFile>...</propertyNameInFile> <initialValue>...</initialValue> <onMissingFile>ignore|warn|fail|create</onMissingFile> <onMissingFileProperty>ignore|warn|fail|create</onMissingFileProperty> <onMissingProperty>ignore|warn|fail</onMissingProperty> </string> ... </strings> -
setDates
Date property definitions.<dates> <date> <id>...</id> <skip>true|false</skip> <export>true|false</export> <value>...</value> <timezone>...</timezone> <format>...</format> <regexp>...</regexp> <transformers>...</transformers> <propertyFile>...</propertyFile> <propertyNameInFile>...</propertyNameInFile> <initialValue>...</initialValue> <onMissingFile>ignore|warn|fail|create</onMissingFile> <onMissingFileProperty>ignore|warn|fail|create</onMissingFileProperty> <onMissingProperty>ignore|warn|fail</onMissingProperty> </date> ... </dates> -
setMacros
Macro definitions.<macros> <macro> <id>...</id> <skip>true|false</skip> <export>true|false</export> <macroType>...</macroType> <macroClass>...</macroClass> <properties> <some-name>some-value</some-name> ... </properties> <format>...</format> <regexp>...</regexp> <transformers>...</transformers> <propertyFile>...</propertyFile> <propertyNameInFile>...</propertyNameInFile> <initialValue>...</initialValue> <onMissingFile>ignore|warn|fail|create</onMissingFile> <onMissingFileProperty>ignore|warn|fail|create</onMissingFileProperty> <onMissingProperty>ignore|warn|fail</onMissingProperty> </macro> ... </macros> -
setUuids
Uuid definitions.<uuids> <uuid> <id>...</id> <skip>true|false</skip> <export>true|false</export> <value>...</value> <format>...</format> <regexp>...</regexp> <transformers>...</transformers> <propertyFile>...</propertyFile> <propertyNameInFile>...</propertyNameInFile> <initialValue>...</initialValue> <onMissingFile>ignore|warn|fail|create</onMissingFile> <onMissingFileProperty>ignore|warn|fail|create</onMissingFileProperty> <onMissingProperty>ignore|warn|fail</onMissingProperty> </uuid> ... </uuids> -
setMacroMap
-
execute
- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getProject
Description copied from interface:FieldContextReturns a reference to theMavenProject.- Specified by:
getProjectin interfaceFieldContext- Returns:
- A
MavenProjectobject
-
getBasedir
Description copied from interface:FieldContextReturns the base dir for this maven build execution.- Specified by:
getBasedirin interfaceFieldContext- Returns:
- A
Fileobject.
-
getSettings
Description copied from interface:FieldContextReturns the current mavenSettingsobject- Specified by:
getSettingsin interfaceFieldContext- Returns:
- A
Settingsobject
-
getMacros
Description copied from interface:FieldContextReturns a map with all known macros. Key value is the macro hint as given by the plexus component annotation.- Specified by:
getMacrosin interfaceFieldContext- Returns:
- A map with all known macros.
-
getProjectProperties
Description copied from interface:FieldContextReturn the maven project properties.- Specified by:
getProjectPropertiesin interfaceFieldContext- Returns:
- A properties object for the project properties.
-
getInterpolatorFactory
Description copied from interface:FieldContextReturns theInterpolatorFactorythat can interpolate "late resolution" properties.- Specified by:
getInterpolatorFactoryin interfaceFieldContext- Returns:
- An
InterpolatorFactoryreference.
-
getTransformerRegistry
Description copied from interface:FieldContextReturns a reference to theTransformerRegistry.- Specified by:
getTransformerRegistryin interfaceFieldContext- Returns:
- A
TransformerRegistryobject.
-
createGroups
-