properties-constants:generate
Full name:
de.r3s6.maven:properties-constants-maven-plugin:0.5.0:generate
Description:
Attributes:
- Requires a Maven project to be executed.
- Requires dependency resolution of artifacts in scope:
compile
. - The goal is not marked as thread-safe and thus does not support parallel builds.
- Binds by default to the lifecycle phase:
generate-sources
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<basePackage> |
String |
- |
Specifies the Java package of the generated Java classes. |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<classNameSuffix> |
String |
- |
Suffix to append to generated class names.
Must be a valid java name by itself, |
<excludes> |
String[] |
- |
File patterns of files to exclude. |
<flattenPackage> |
boolean |
- |
Whether all constants file end up in base package independent of the directory structure.
By default the constants Java classes of properties files located in sub-directories of If Default value is: false . |
<includes> |
String[] |
- |
File patterns of files to include. Default value is: *.properties . |
<outputDir> |
File |
- |
Output directory for generated java files. Default value is: ${project.build.directory}/generated-sources/prop-constants . |
<resourceDir> |
File |
- |
Directory to search for properties files. Default value is: src/main/resources . |
<skip> |
boolean |
- |
Whether to skip the plugin execution. User property is: properties-constants.skip . |
<sourceEncoding> |
String |
- |
Specifies the character encoding of the generated Java files. Default value is: ${project.build.sourceEncoding} . |
<template> |
String |
- |
Template id or file name.
The plugin provides the templates A file name can be given for a custom Freemarker template. File name lookup is:
Default value is: keys . |
<templateOptions> |
Map<String,String> |
- |
Additional options for the selected template.
The template
|
Parameter Details
<basePackage>
- Type:
java.lang.String
- Required:
Yes
<classNameSuffix>
Must be a valid java name by itself, SourceVersion.isIdentifier(classNameSuffix))
must return true.
- Type:
java.lang.String
- Required:
No
<excludes>
- Type:
java.lang.String[]
- Required:
No
<flattenPackage>
By default the constants Java classes of properties files located in sub-directories of resourceDir
will be put in a matching sub-packages of basePackage
.
If flattenPackage
is true, all classes will end up in basePackage
. Note that this might lead to name collisions.
- Type:
boolean
- Required:
No
- Default:
false
<includes>
- Type:
java.lang.String[]
- Required:
No
- Default:
*.properties
<outputDir>
- Type:
java.io.File
- Required:
No
- Default:
${project.build.directory}/generated-sources/prop-constants
<resourceDir>
- Type:
java.io.File
- Required:
No
- Default:
src/main/resources
<skip>
- Type:
boolean
- Required:
No
- User Property:
properties-constants.skip
<sourceEncoding>
- Type:
java.lang.String
- Required:
No
- Default:
${project.build.sourceEncoding}
<template>
The plugin provides the templates keys
and values
.
A file name can be given for a custom Freemarker template. File name lookup is:
- classpath
- relative to project basedir
- Type:
java.lang.String
- Required:
No
- Default:
keys
<templateOptions>
The template keys
supports the following options:
- genPropertiesFilenameConstant
-
generate the constant
PROPERTIES_FILE_NAME
- propertiesFilenameConstant
- changes the name of the properties file name constant
- genBundleNameConstant
-
generate the constant
BUNDLE_NAME
- bundleNameConstant
- changes the name of the bundle name constant
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No