Class PropertiesMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.tentackle.maven.AbstractTentackleMojo
org.tentackle.maven.plugin.PropertiesMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
@Mojo(name="properties",
defaultPhase=GENERATE_RESOURCES,
requiresDependencyResolution=COMPILE,
threadSafe=true)
public class PropertiesMojo
extends AbstractTentackleMojo
Generates maven properties from other maven properties.
Example:
<propertyDescriptors>
<propertyDescriptor>
<input>${dbPasswd}</input>
<converter>@org.tentackle.common.Cryptor</converter>
<property>encryptedPasswd</property>
</propertyDescriptor>
</propertyDescriptors>
The converter is the FQCN of a class implementing Function<String,String> with a public no-args
constructor. Because it must be in the classpath of the tentackle-maven-plugin, its artifact must
be placed within the plugin's <dependencies>.
If the FQCN starts with an @, the converter is looked up via META-INF/services.
The generated properties are visible to all plugins executed later in the build of the same module, for example to resource filtering, but not to values of the pom that have already been interpolated.
Important: the converters must be stateless because one instance per converter is shared by all property descriptors of an execution!
- Author:
- harald
-
Field Summary
Fields inherited from class AbstractTentackleMojo
charset, JDK_TOOLCHAIN, minLogLevel, verbosity, verbosityLevelFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractTentackleMojo
createFileSetManager, createPackageMap, determineEncoding, determineJavaToolVersion, determineVerbosity, execute, finishExecute, getBaseDir, getCanonicalPath, getExecutionLock, getHostName, getIncludedFiles, getJavaHome, getLogger, getMajorVersion, getMavenProject, getMavenSession, getMojoExecution, getPathRelativeToBasedir, getRepositorySystem, getResourceDir, getResourceDirs, getSettings, getSettingsDecrypter, getToolchain, getToolchain, getToolchain, getToolchainManager, getToolFinder, installJavaLoggingHandler, isExecutionRecursive, isSkippedByDefault, loadResourceFileIntoString, prepareExecute, setLogger, toDescriptorName, validateMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Constructor Details
-
PropertiesMojo
public PropertiesMojo()
-
-
Method Details
-
executeImpl
public void executeImpl() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
executeImplin classAbstractTentackleMojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-