https://github.com/nielsbasjes/stringtemplate-maven-plugin
https://github.com/nielsbasjes/stringtemplate-maven-plugin
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nielsbasjes/stringtemplate-maven-plugin
- Owner: nielsbasjes
- License: apache-2.0
- Created: 2023-05-25T14:59:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-21T07:20:16.000Z (about 1 year ago)
- Last Synced: 2024-04-21T10:38:01.711Z (about 1 year ago)
- Language: Java
- Size: 81.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/nielsbasjes/stringtemplate-maven-plugin/actions)
[](https://app.codecov.io/gh/nielsbasjes/stringtemplate-maven-plugin)
[](https://www.apache.org/licenses/LICENSE-2.0.html)
[](https://central.sonatype.com/namespace/nl.basjes.stringtemplate)
[](https://github.com/nielsbasjes/stringtemplate-maven-plugin/stargazers)
[](https://www.paypal.me/nielsbasjes)[//]: # ([](https://github.com/jvm-repo-rebuild/reproducible-central#nl.basjes.stringtemplate:stringtemplate-maven-plugin))
# What is this?
A maven plugin that uses the [StringTemplate 4](https://www.stringtemplate.org/) templating engine to generate a file.Current version does exactly one file at a time.
# Usage
The most basic template file needed to use this plugin looks like this:Render(properties) ::= <<
properties:
: ''}; separator="\n">
>>Note: The `Render(properties)` entrypoint is hardcoded in the plugin.
In the `pom.xml` you need to specify the `templateFile`, the `outputFile` and the `properties`.
You can specify `properties` directly and/or by reading them from a `propertyFile`.If both the pom.xml and the property file contain the same key then the value from the pom.xml is used.
A property file looks something like this
# Comment
test= aap
something.name: NootThen the plugin can be called with something like this
nl.basjes.stringtemplate
stringtemplate-maven-plugin
${stringtemplate-maven-plugin.version}
generate it
generate-sources
render
${project.basedir}/GenerateTest.stg
${project.basedir}/target/Generated.yaml
AaP
NooT
MieS
${project.version}
extra.properties
# License
StringTemplate Maven Plugin
Copyright (C) 2023 Niels BasjesLicensed 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 athttps://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.