Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olivierlemasle/plaintext-maven-plugin
A simple Maven plugin to create a plain text file or append lines to a plain text file.
https://github.com/olivierlemasle/plaintext-maven-plugin
maven maven-plugin
Last synced: 4 months ago
JSON representation
A simple Maven plugin to create a plain text file or append lines to a plain text file.
- Host: GitHub
- URL: https://github.com/olivierlemasle/plaintext-maven-plugin
- Owner: olivierlemasle
- License: apache-2.0
- Created: 2016-10-02T08:31:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T01:42:33.000Z (over 4 years ago)
- Last Synced: 2024-04-20T08:13:03.051Z (10 months ago)
- Topics: maven, maven-plugin
- Language: Java
- Size: 20.5 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
plaintext-maven-plugin
======================[![Build Status](https://travis-ci.org/olivierlemasle/plaintext-maven-plugin.svg?branch=master)](https://travis-ci.org/olivierlemasle/plaintext-maven-plugin)
[![Build status](https://ci.appveyor.com/api/projects/status/ce47h0ag0v1idv8g/branch/master?svg=true)](https://ci.appveyor.com/project/olivierlemasle/plaintext-maven-plugin/branch/master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.olivierlemasle.maven/plaintext-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.olivierlemasle.maven/plaintext-maven-plugin)Goals
------ `plaintext:write`
- `plaintext:help`Usage
-----### Example 1: Generate a file during `generate-resources` phase
```xml
io.github.olivierlemasle.maven
plaintext-maven-plugin
1.0.0
main/resources/META-INF/file-name.txt
This is a test file.
Packaged by ${build_user}
generate-file
write
```
This will create during `generate-resources` phase a file `file-name.txt` in
`target/main/resources/META-INF`, with the content defined in the POM file, using property
extrapolation if needed. If the file already exists, it will be overridden.### Example 2: Append version number to a resource file during release
```xml
io.github.olivierlemasle.maven
plaintext-maven-plugin
1.0.0
${project.basedir}/src/main/resources
versions
true
${project.version}
org.apache.maven.plugins
maven-scm-plugin
1.9.5
src/main/resources/versions
Append ${project.version} to "versions"
org.apache.maven.plugins
maven-release-plugin
2.5.3
clean plaintext:write scm:add scm:checkin verify
```
With this configuration, `mvn release:prepare` will append the project version to a file
named `versions` in source directory `src/main/resources`, or create it if the file does not exist.
It will then add the file to version control and commit it while preparing the release.License
-------```
Copyright 2016 Olivier LemasleLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```