https://github.com/chonton/readfiles-maven-plugin
Read Files into Maven Properties
https://github.com/chonton/readfiles-maven-plugin
maven-plugin
Last synced: 6 months ago
JSON representation
Read Files into Maven Properties
- Host: GitHub
- URL: https://github.com/chonton/readfiles-maven-plugin
- Owner: chonton
- License: apache-2.0
- Created: 2018-02-24T23:23:04.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-07T16:36:35.000Z (7 months ago)
- Last Synced: 2024-11-20T04:44:16.306Z (7 months ago)
- Topics: maven-plugin
- Language: Java
- Homepage:
- Size: 80.1 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# readfiles-maven-plugin
Read files into maven properties.
Mojo details at [plugin info](https://chonton.github.io/readfiles-maven-plugin/0.0.1/plugin-info.html)
Just one goal: [readfiles](https://chonton.github.io/readfiles-maven-plugin/0.0.1/readfiles-mojo.html)
sets maven properties to the contents of files. Each file is read fully and the contents are
set to maven properties of the same name as the files.Optionally, the contents of the file can be trimmed of whitespace, or transformed using a series of
regular expression patterns and replacements.
| Parameter | Default | Property | Description |
|-------------------|---------|---------------------------------|------------------------------------------------|
| files | | | The list of files to read |
| encoding | UTF-8 | ${project.build.sourceEncoding} | The character encoding of the file |
| prefix | | ${readfiles.prefix} | Prefix each property name with this value |
| regexReplacements | | | List of pattern replacements |
| skip | false | ${readfiles.skip} | Skip executing the plugin |
| trim | false | ${readfiles.skip} | Trim whitespace from beginning and end of file |## regexReplacement Elements
| Parameter | Description |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------|
| pattern | A [java regular expression](https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/regex/Pattern.html) |
| replacement | The [replaceAll value](https://docs.oracle.com/en/java/javase/23/docs/api/java.base/java/util/regex/Matcher.html#replaceAll(java.lang.String)) |## Typical use:
```xml
org.honton.chas
readfiles-maven-plugin
0.1.0
configurations
readfiles
${basedir}/src/main/resources/application.json
${basedir}/src/main/resources/environment.conf
index.html
readfiles
iso-8859-1
page.
${basedir}/src/main/resources/index.html
```## Pattern Replacement:
```xml
org.honton.chas
readfiles-maven-plugin
${basedir}/.nvmrc
^v?(\S+)\s*$
v$1
```