This is an automated email from the ASF dual-hosted git repository. sgoeschl pushed a commit to branch FREEMARKER-129 in repository https://gitbox.apache.org/repos/asf/freemarker-generator.git
commit 8ee1967111c1ee5f436d4aa1c341779cd7d337a9 Author: Siegfried Goeschl <[email protected]> AuthorDate: Tue Jan 28 21:31:27 2020 +0100 FREEMARKER-129 Move maven plugin into its own sub-module --- .gitignore | 22 +- CHANGELOG.md => maven-plugin/CHANGELOG.md | 0 LICENSE => maven-plugin/LICENSE | 446 ++++++++++----------- NOTICE => maven-plugin/NOTICE | 10 +- README.md => maven-plugin/README.md | 368 ++++++++--------- pom.xml => maven-plugin/pom.xml | 19 +- .../apache/freemarker/generator/FactoryUtil.java | 0 .../freemarker/generator/FreeMarkerMojo.java | 0 .../generator/GeneratingFileVisitor.java | 0 .../generator/JsonPropertiesProvider.java | 0 .../freemarker/generator/OutputGenerator.java | 0 .../OutputGeneratorPropertiesProvider.java | 0 .../test/data/freemarker-mojo/data/test.txt.json | 0 .../data/freemarker-mojo/freemarker.properties | 0 .../test/data/freemarker-mojo/template/test.ftl | 0 .../badPath/success-test.txt.json | 0 .../data/badParent/bad-parent-test.txt.json | 0 .../data/mydir/bad-extension-test.txt | 0 .../data/mydir/bad-template-name.txt.json | 0 .../data/mydir/missing-template-name.txt.json | 0 .../data/mydir/missing-var-test.txt.json | 0 .../data/mydir/success-test-2.txt.json | 0 .../data/mydir/success-test.txt.json | 0 .../template/test-pom-only.ftl | 0 .../data/generating-file-visitor/template/test.ftl | 0 .../freemarker/generator/FreeMarkerMojoTest.java | 0 .../generator/GeneratingFileVisitorTest.java | 0 .../generator/JsonPropertiesProviderTest.java | 0 .../freemarker/generator/OutputGeneratorTest.java | 0 pom.xml | 314 +++++++-------- 30 files changed, 568 insertions(+), 611 deletions(-) diff --git a/.gitignore b/.gitignore index 57e5d5b..4718a9d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,17 +15,17 @@ # specific language governing permissions and limitations # under the License. -/.ivy/ -/.bin/ -/build/ -/build.properties -/archive/ -/ide-dependencies/ -/META-INF - -/out/ -/bin/ -/target/ +.ivy/ +.bin/ +build/ +build.properties +archive/ +ide-dependencies/ +META-INF + +out/ +bin/ +target/ .classpath .project diff --git a/CHANGELOG.md b/maven-plugin/CHANGELOG.md similarity index 100% rename from CHANGELOG.md rename to maven-plugin/CHANGELOG.md diff --git a/LICENSE b/maven-plugin/LICENSE similarity index 98% rename from LICENSE rename to maven-plugin/LICENSE index de286ad..1121eba 100644 --- a/LICENSE +++ b/maven-plugin/LICENSE @@ -1,223 +1,223 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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 at - - http://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. - -========================================================================= - -The source code contains the following binaries, -which were created at the Apache FreeMarker project, and hence are -covered by the same license as the other source files of it: - - src/main/misc/overloadedNumberRules/prices.ods - src/manual/en_US/docgen-originals/figures/overview.odg - src/manual/en_US/docgen-originals/figures/model2sketch_with_alpha.png - src/manual/en_US/docgen-originals/figures/tree_with_alpha.png - src/manual/en_US/favicon.png - src/manual/en_US/figures/model2sketch.png - src/manual/en_US/figures/overview.png - src/manual/en_US/figures/tree.png - src/manual/en_US/logo.png - src/manual/zh_CN/favicon.png - src/manual/zh_CN/figures/model2sketch.png - src/manual/zh_CN/figures/overview.png - src/manual/zh_CN/figures/tree.png - src/manual/zh_CN/logo.png + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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 at + + http://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. + +========================================================================= + +The source code contains the following binaries, +which were created at the Apache FreeMarker project, and hence are +covered by the same license as the other source files of it: + + src/main/misc/overloadedNumberRules/prices.ods + src/manual/en_US/docgen-originals/figures/overview.odg + src/manual/en_US/docgen-originals/figures/model2sketch_with_alpha.png + src/manual/en_US/docgen-originals/figures/tree_with_alpha.png + src/manual/en_US/favicon.png + src/manual/en_US/figures/model2sketch.png + src/manual/en_US/figures/overview.png + src/manual/en_US/figures/tree.png + src/manual/en_US/logo.png + src/manual/zh_CN/favicon.png + src/manual/zh_CN/figures/model2sketch.png + src/manual/zh_CN/figures/overview.png + src/manual/zh_CN/figures/tree.png + src/manual/zh_CN/logo.png diff --git a/NOTICE b/maven-plugin/NOTICE similarity index 97% rename from NOTICE rename to maven-plugin/NOTICE index bc6e606..929539f 100644 --- a/NOTICE +++ b/maven-plugin/NOTICE @@ -1,5 +1,5 @@ -Apache FreeMarker -Copyright 2015-2018 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). +Apache FreeMarker +Copyright 2015-2018 The Apache Software Foundation + +This product includes software developed at +The Apache Software Foundation (http://www.apache.org/). diff --git a/README.md b/maven-plugin/README.md similarity index 97% rename from README.md rename to maven-plugin/README.md index 3a6db0d..474a75e 100644 --- a/README.md +++ b/maven-plugin/README.md @@ -1,184 +1,184 @@ -Apache FreeMarker Generator -=========================== - -For documentation or to report bugs visit: -https://freemarker.apache.org/generator.html - - -Regarding pull requests on Github ---------------------------------- - -By sending a pull request you grant the Apache Software Foundation -sufficient rights to use and release the submitted work under the -Apache license. You grant the same rights (copyright license, patent -license, etc.) to the Apache Software Foundation as if you have signed -a [Contributor License Agreement](https://www.apache.org/dev/new-committers-guide.html#cla). -For contributions that are judged to be non-trivial, you will be asked -to actually signing a Contributor License Agreement. - - -What is Apache FreeMarker Generator? ------------------------------------- - -FreeMarker Generator is a tool that generates files based on FreeMarker -templates and data that's typically provided in files (such as JSON files) as -well. It can be used to generated source code, configuration files, etc. - -Currently it can be invoked as a Maven plug-in, but in the future it might -will be callable on other ways (say, from Gradle, or as a standalone command -line tool). - -freemarker-generator-maven-plugin ---------------------------------- -## Table of contents - -- [Background](#background) -- [Install](#install) -- [Usage](#usage) - - [FreeMarker Template Files](#freemarker-template-files) - - [JSON Generator Files](#json-generator-files) - - [Using POM Properties During Generation](#using-pom-properties-during-generation) - - [FreeMarker Configuration](#freemarker-configuration) - - [Incremental Builds](#incremental-builds) -- [Code Coverage](#code-coverage) -- [Contributing](#contributing) -- [License](#license) - -## Background -This plugin generates source files from FreeMarker templates with a flexible process that includes the ability to: - -- Generate multiple source files from a single template, -- Generate source files during multiple steps in the build process such as testing, and -- Specify distinct locations for the templates and data models for different stages of the build. - -## Install -### pom.xml - -Add the following snippet within the `<plugins>` tag of your pom.xml: - -```xml - <plugin> - <groupId>com.oath</groupId> - <artifactId>freemarker-maven-plugin</artifactId> - <version>${freemarker-maven-plugin.version}</version> - <configuration> - <!-- Required. Specifies the compatibility version for template processing --> - <freeMarkerVersion>2.3.23</freeMarkerVersion> - </configuration> - <executions> - <!-- If you want to generate files during other phases, just add more execution - tags and specify appropriate phase, sourceDirectory and outputDirectory values. - --> - <execution> - <id>freemarker</id> - <!-- Optional, defaults to generate-sources --> - <phase>generate-sources</phase> - <goals> - <!-- Required, must be generate --> - <goal>generate</goal> - </goals> - <configuration> - <!-- Optional, defaults to src/main/freemarker/generator --> - <sourceDirectory>src/main/freemarker</sourceDirectory> - <!-- Optional, defaults to src/main/freemarker/generator/template --> - <templateDirectory>src/main/freemarker/template</templateDirectory> - <!-- Optional, defaults to src/main/freemarker/generator --> - <generatorDirectory>src/main/freemarker/generator/generator</generatorDirectory> - <!-- Optional, defaults to target/generated-sources/freemarker --> - <outputDirectory>target/generated-sources/freemarker/generator</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> -``` - -## Usage - -### FreeMarker Template Files -FreeMarker template files must reside in the `templateDirectory`. For the default configuration, -this is: `src/main/freemarker/generator/template`. - -By convention, file names for FreeMarker template files use the .ftl extension. For details on the FreeMarker -template syntax, see: [Getting Started](https://freemarker.apache.org/docs/dgui_quickstart.html) and -[Template Language Reference](https://freemarker.apache.org/docs/ref.html). - -### JSON Generator Files -The JSON generator files must reside in the `generatorDirectory`. For the default -configuration, this is: `src/main/freemarker/generator/generator`. - -For each JSON generator file, freemarker-maven-plugin will generate a file under the outputDirectory. -The name of the generated file will be based on the name of the JSON data file. For example, -the following JSON file: -``` - <sourceDirectory>/data/my/package/MyClass.java.json -``` -will result in the following file being generated: -``` - <outputDirectory>/my/package/MyClass.java -``` - -This plugin parses the JSON generator file's `dataModel` field into a `Map<String, Object>` instance (hereafter, referred -to as the data model). If the dataModel field is empty, an empty map will be created. - -Here are some additional details you need to know. - - - This plugin *requires* one top-level field in the JSON data file: `templateName`. This field is used to locate the template file under `<sourceDirectory>/template` that is used to generate the file. This plugin provides the data model to FreeMarker as the data model to process the template identified by `templateName`. - - The parser allows for comments. - - This plugin currently assumes that the JSON data file encoded using UTF-8. - -Here is an example JSON data file: -```json -{ - // An end-of-line comment. - # Another end-of-line comment - "templateName": "my-template.ftl", #Required - "dataModel": { #Optional - /* A multi-line - comment */ - "myString": "a string", - "myNumber": 1, - "myListOfStrings": ["s1", "s2"], - "myListOfNumbers": [1, 2], - "myMap": { - "key1": "value1", - "key2": 2 - } - } -} -``` - -### Using POM Properties During Generation -After parsing the JSON file, the plugin will add -a `pomProperties` entry into the data model, which is a map itself, that contains the properties defined in the pom. Thus, your template can reference the pom property `my_property` using `${pomProperties.my_property}`. If you have a period or dash in the property name, use `${pomProperties["my.property"]}`. - - - -### FreeMarker Configuration - -Typically, users of this plugin do not need to mess with the FreeMarker configuration. This plugin explicitly sets two FreeMarker configurations: - - 1. the default encoding is set to UTF-8 - 2. the template loader is set to be a FileTemplateLoader that reads from `templateDirectory`. - -If you need to override these configs or set your own, you can put them in a -`<sourceDirectory>/freemarker.properties` file. If that file exists, this plugin will read it into a java Properties instance and pass it to freemarker.core.Configurable.setSettings() to establish the FreeMarker configuration. See this [javadoc](https://freemarker.apache.org/docs/api/freemarker/template/Configuration.html#setSetting-java.lang.String-java.lang.String-) for configuration details. - - -### Incremental Builds -This plugin supports incremental builds; it only generates sources if the generator file, template file, or pom file have timestamps newer than any existing output file. To force a rebuild if these conditions are not met (for example, if you pass in a model parameter on the command line), first run `mvn clean`. - -## Code Coverage - -By default, the code coverage report is not generated. It is generated by screwdriver jobs. You can generate code coverage on your dev machine with the following maven command: -```bash -mvn clean initialize -Dclover-phase=initialize -``` -Bring up the coverage report by pointing your browser to target/site/clover/dashboard.html under the root directory of the local repository. - - -Licensing ---------- - -Apache FreeMarker Generator is licensed under the Apache License, Version 2.0. - -See the LICENSE file for more details! +Apache FreeMarker Generator +=========================== + +For documentation or to report bugs visit: +https://freemarker.apache.org/generator.html + + +Regarding pull requests on Github +--------------------------------- + +By sending a pull request you grant the Apache Software Foundation +sufficient rights to use and release the submitted work under the +Apache license. You grant the same rights (copyright license, patent +license, etc.) to the Apache Software Foundation as if you have signed +a [Contributor License Agreement](https://www.apache.org/dev/new-committers-guide.html#cla). +For contributions that are judged to be non-trivial, you will be asked +to actually signing a Contributor License Agreement. + + +What is Apache FreeMarker Generator? +------------------------------------ + +FreeMarker Generator is a tool that generates files based on FreeMarker +templates and data that's typically provided in files (such as JSON files) as +well. It can be used to generated source code, configuration files, etc. + +Currently it can be invoked as a Maven plug-in, but in the future it might +will be callable on other ways (say, from Gradle, or as a standalone command +line tool). + +freemarker-generator-maven-plugin +--------------------------------- +## Table of contents + +- [Background](#background) +- [Install](#install) +- [Usage](#usage) + - [FreeMarker Template Files](#freemarker-template-files) + - [JSON Generator Files](#json-generator-files) + - [Using POM Properties During Generation](#using-pom-properties-during-generation) + - [FreeMarker Configuration](#freemarker-configuration) + - [Incremental Builds](#incremental-builds) +- [Code Coverage](#code-coverage) +- [Contributing](#contributing) +- [License](#license) + +## Background +This plugin generates source files from FreeMarker templates with a flexible process that includes the ability to: + +- Generate multiple source files from a single template, +- Generate source files during multiple steps in the build process such as testing, and +- Specify distinct locations for the templates and data models for different stages of the build. + +## Install +### pom.xml + +Add the following snippet within the `<plugins>` tag of your pom.xml: + +```xml + <plugin> + <groupId>com.oath</groupId> + <artifactId>freemarker-maven-plugin</artifactId> + <version>${freemarker-maven-plugin.version}</version> + <configuration> + <!-- Required. Specifies the compatibility version for template processing --> + <freeMarkerVersion>2.3.23</freeMarkerVersion> + </configuration> + <executions> + <!-- If you want to generate files during other phases, just add more execution + tags and specify appropriate phase, sourceDirectory and outputDirectory values. + --> + <execution> + <id>freemarker</id> + <!-- Optional, defaults to generate-sources --> + <phase>generate-sources</phase> + <goals> + <!-- Required, must be generate --> + <goal>generate</goal> + </goals> + <configuration> + <!-- Optional, defaults to src/main/freemarker/generator --> + <sourceDirectory>src/main/freemarker</sourceDirectory> + <!-- Optional, defaults to src/main/freemarker/generator/template --> + <templateDirectory>src/main/freemarker/template</templateDirectory> + <!-- Optional, defaults to src/main/freemarker/generator --> + <generatorDirectory>src/main/freemarker/generator/generator</generatorDirectory> + <!-- Optional, defaults to target/generated-sources/freemarker --> + <outputDirectory>target/generated-sources/freemarker/generator</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> +``` + +## Usage + +### FreeMarker Template Files +FreeMarker template files must reside in the `templateDirectory`. For the default configuration, +this is: `src/main/freemarker/generator/template`. + +By convention, file names for FreeMarker template files use the .ftl extension. For details on the FreeMarker +template syntax, see: [Getting Started](https://freemarker.apache.org/docs/dgui_quickstart.html) and +[Template Language Reference](https://freemarker.apache.org/docs/ref.html). + +### JSON Generator Files +The JSON generator files must reside in the `generatorDirectory`. For the default +configuration, this is: `src/main/freemarker/generator/generator`. + +For each JSON generator file, freemarker-maven-plugin will generate a file under the outputDirectory. +The name of the generated file will be based on the name of the JSON data file. For example, +the following JSON file: +``` + <sourceDirectory>/data/my/package/MyClass.java.json +``` +will result in the following file being generated: +``` + <outputDirectory>/my/package/MyClass.java +``` + +This plugin parses the JSON generator file's `dataModel` field into a `Map<String, Object>` instance (hereafter, referred +to as the data model). If the dataModel field is empty, an empty map will be created. + +Here are some additional details you need to know. + + - This plugin *requires* one top-level field in the JSON data file: `templateName`. This field is used to locate the template file under `<sourceDirectory>/template` that is used to generate the file. This plugin provides the data model to FreeMarker as the data model to process the template identified by `templateName`. + - The parser allows for comments. + - This plugin currently assumes that the JSON data file encoded using UTF-8. + +Here is an example JSON data file: +```json +{ + // An end-of-line comment. + # Another end-of-line comment + "templateName": "my-template.ftl", #Required + "dataModel": { #Optional + /* A multi-line + comment */ + "myString": "a string", + "myNumber": 1, + "myListOfStrings": ["s1", "s2"], + "myListOfNumbers": [1, 2], + "myMap": { + "key1": "value1", + "key2": 2 + } + } +} +``` + +### Using POM Properties During Generation +After parsing the JSON file, the plugin will add +a `pomProperties` entry into the data model, which is a map itself, that contains the properties defined in the pom. Thus, your template can reference the pom property `my_property` using `${pomProperties.my_property}`. If you have a period or dash in the property name, use `${pomProperties["my.property"]}`. + + + +### FreeMarker Configuration + +Typically, users of this plugin do not need to mess with the FreeMarker configuration. This plugin explicitly sets two FreeMarker configurations: + + 1. the default encoding is set to UTF-8 + 2. the template loader is set to be a FileTemplateLoader that reads from `templateDirectory`. + +If you need to override these configs or set your own, you can put them in a +`<sourceDirectory>/freemarker.properties` file. If that file exists, this plugin will read it into a java Properties instance and pass it to freemarker.core.Configurable.setSettings() to establish the FreeMarker configuration. See this [javadoc](https://freemarker.apache.org/docs/api/freemarker/template/Configuration.html#setSetting-java.lang.String-java.lang.String-) for configuration details. + + +### Incremental Builds +This plugin supports incremental builds; it only generates sources if the generator file, template file, or pom file have timestamps newer than any existing output file. To force a rebuild if these conditions are not met (for example, if you pass in a model parameter on the command line), first run `mvn clean`. + +## Code Coverage + +By default, the code coverage report is not generated. It is generated by screwdriver jobs. You can generate code coverage on your dev machine with the following maven command: +```bash +mvn clean initialize -Dclover-phase=initialize +``` +Bring up the coverage report by pointing your browser to target/site/clover/dashboard.html under the root directory of the local repository. + + +Licensing +--------- + +Apache FreeMarker Generator is licensed under the Apache License, Version 2.0. + +See the LICENSE file for more details! diff --git a/pom.xml b/maven-plugin/pom.xml similarity index 91% copy from pom.xml copy to maven-plugin/pom.xml index 7e826cb..2c2a68b 100644 --- a/pom.xml +++ b/maven-plugin/pom.xml @@ -2,30 +2,29 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.freemarker</groupId> - <artifactId>freemarker-generator-maven-plugin</artifactId> - <version>1.0.0-SNAPSHOT</version> + <parent> + <groupId>org.apache.freemarker.generator</groupId> + <artifactId>parent</artifactId> + <version>0.1.0-SNAPSHOT</version> + </parent> + + <artifactId>freemarker-maven-plugin</artifactId> <packaging>maven-plugin</packaging> - <name>Freemarker Generator Maven Plugin</name> + <name>Apache FreeMarker Generator: Maven Plugin</name> <url>http://freemarker.apache.org/</url> <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> <maven-core.version>3.5.2</maven-core.version> <maven-plugin-api.version>3.5.2</maven-plugin-api.version> <maven-plugin-annotations.version>3.5</maven-plugin-annotations.version> <fastutil.version>8.1.0</fastutil.version> - <freemarker.version>2.3.29</freemarker.version> <gson.version>2.8.6</gson.version> <jmockit.version>1.32</jmockit.version> <org.testng.version>6.8</org.testng.version> <assertj-core.version>3.8.0</assertj-core.version> <clover-target-percentage>100</clover-target-percentage> <clover-phase>pre-site</clover-phase> - <target-jdk-version>1.8</target-jdk-version> </properties> <dependencies> @@ -141,7 +140,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> - <version>3.6.0</version> <configuration> <goalPrefix>freemarker</goalPrefix> </configuration> @@ -158,7 +156,6 @@ <plugin> <groupId>org.openclover</groupId> <artifactId>clover-maven-plugin</artifactId> - <version>4.2.0</version> <executions> <execution> <id>clover</id> diff --git a/src/main/java/org/apache/freemarker/generator/FactoryUtil.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/FactoryUtil.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/FactoryUtil.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/FactoryUtil.java diff --git a/src/main/java/org/apache/freemarker/generator/FreeMarkerMojo.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/FreeMarkerMojo.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/FreeMarkerMojo.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/FreeMarkerMojo.java diff --git a/src/main/java/org/apache/freemarker/generator/GeneratingFileVisitor.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/GeneratingFileVisitor.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/GeneratingFileVisitor.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/GeneratingFileVisitor.java diff --git a/src/main/java/org/apache/freemarker/generator/JsonPropertiesProvider.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/JsonPropertiesProvider.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/JsonPropertiesProvider.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/JsonPropertiesProvider.java diff --git a/src/main/java/org/apache/freemarker/generator/OutputGenerator.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/OutputGenerator.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/OutputGenerator.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/OutputGenerator.java diff --git a/src/main/java/org/apache/freemarker/generator/OutputGeneratorPropertiesProvider.java b/maven-plugin/src/main/java/org/apache/freemarker/generator/OutputGeneratorPropertiesProvider.java similarity index 100% rename from src/main/java/org/apache/freemarker/generator/OutputGeneratorPropertiesProvider.java rename to maven-plugin/src/main/java/org/apache/freemarker/generator/OutputGeneratorPropertiesProvider.java diff --git a/src/test/data/freemarker-mojo/data/test.txt.json b/maven-plugin/src/test/data/freemarker-mojo/data/test.txt.json similarity index 100% rename from src/test/data/freemarker-mojo/data/test.txt.json rename to maven-plugin/src/test/data/freemarker-mojo/data/test.txt.json diff --git a/src/test/data/freemarker-mojo/freemarker.properties b/maven-plugin/src/test/data/freemarker-mojo/freemarker.properties similarity index 100% rename from src/test/data/freemarker-mojo/freemarker.properties rename to maven-plugin/src/test/data/freemarker-mojo/freemarker.properties diff --git a/src/test/data/freemarker-mojo/template/test.ftl b/maven-plugin/src/test/data/freemarker-mojo/template/test.ftl similarity index 100% rename from src/test/data/freemarker-mojo/template/test.ftl rename to maven-plugin/src/test/data/freemarker-mojo/template/test.ftl diff --git a/src/test/data/generating-file-visitor/badPath/success-test.txt.json b/maven-plugin/src/test/data/generating-file-visitor/badPath/success-test.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/badPath/success-test.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/badPath/success-test.txt.json diff --git a/src/test/data/generating-file-visitor/data/badParent/bad-parent-test.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/badParent/bad-parent-test.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/badParent/bad-parent-test.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/badParent/bad-parent-test.txt.json diff --git a/src/test/data/generating-file-visitor/data/mydir/bad-extension-test.txt b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/bad-extension-test.txt similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/bad-extension-test.txt rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/bad-extension-test.txt diff --git a/src/test/data/generating-file-visitor/data/mydir/bad-template-name.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/bad-template-name.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/bad-template-name.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/bad-template-name.txt.json diff --git a/src/test/data/generating-file-visitor/data/mydir/missing-template-name.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/missing-template-name.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/missing-template-name.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/missing-template-name.txt.json diff --git a/src/test/data/generating-file-visitor/data/mydir/missing-var-test.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/missing-var-test.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/missing-var-test.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/missing-var-test.txt.json diff --git a/src/test/data/generating-file-visitor/data/mydir/success-test-2.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/success-test-2.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/success-test-2.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/success-test-2.txt.json diff --git a/src/test/data/generating-file-visitor/data/mydir/success-test.txt.json b/maven-plugin/src/test/data/generating-file-visitor/data/mydir/success-test.txt.json similarity index 100% rename from src/test/data/generating-file-visitor/data/mydir/success-test.txt.json rename to maven-plugin/src/test/data/generating-file-visitor/data/mydir/success-test.txt.json diff --git a/src/test/data/generating-file-visitor/template/test-pom-only.ftl b/maven-plugin/src/test/data/generating-file-visitor/template/test-pom-only.ftl similarity index 100% rename from src/test/data/generating-file-visitor/template/test-pom-only.ftl rename to maven-plugin/src/test/data/generating-file-visitor/template/test-pom-only.ftl diff --git a/src/test/data/generating-file-visitor/template/test.ftl b/maven-plugin/src/test/data/generating-file-visitor/template/test.ftl similarity index 100% rename from src/test/data/generating-file-visitor/template/test.ftl rename to maven-plugin/src/test/data/generating-file-visitor/template/test.ftl diff --git a/src/test/java/org/apache/freemarker/generator/FreeMarkerMojoTest.java b/maven-plugin/src/test/java/org/apache/freemarker/generator/FreeMarkerMojoTest.java similarity index 100% rename from src/test/java/org/apache/freemarker/generator/FreeMarkerMojoTest.java rename to maven-plugin/src/test/java/org/apache/freemarker/generator/FreeMarkerMojoTest.java diff --git a/src/test/java/org/apache/freemarker/generator/GeneratingFileVisitorTest.java b/maven-plugin/src/test/java/org/apache/freemarker/generator/GeneratingFileVisitorTest.java similarity index 100% rename from src/test/java/org/apache/freemarker/generator/GeneratingFileVisitorTest.java rename to maven-plugin/src/test/java/org/apache/freemarker/generator/GeneratingFileVisitorTest.java diff --git a/src/test/java/org/apache/freemarker/generator/JsonPropertiesProviderTest.java b/maven-plugin/src/test/java/org/apache/freemarker/generator/JsonPropertiesProviderTest.java similarity index 100% rename from src/test/java/org/apache/freemarker/generator/JsonPropertiesProviderTest.java rename to maven-plugin/src/test/java/org/apache/freemarker/generator/JsonPropertiesProviderTest.java diff --git a/src/test/java/org/apache/freemarker/generator/OutputGeneratorTest.java b/maven-plugin/src/test/java/org/apache/freemarker/generator/OutputGeneratorTest.java similarity index 100% rename from src/test/java/org/apache/freemarker/generator/OutputGeneratorTest.java rename to maven-plugin/src/test/java/org/apache/freemarker/generator/OutputGeneratorTest.java diff --git a/pom.xml b/pom.xml index 7e826cb..da63d34 100644 --- a/pom.xml +++ b/pom.xml @@ -1,182 +1,142 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> - <groupId>org.apache.freemarker</groupId> - <artifactId>freemarker-generator-maven-plugin</artifactId> - <version>1.0.0-SNAPSHOT</version> - <packaging>maven-plugin</packaging> + <parent> + <groupId>org.apache</groupId> + <artifactId>apache</artifactId> + <version>23</version> + </parent> + + <groupId>org.apache.freemarker.generator</groupId> + <artifactId>parent</artifactId> + <packaging>pom</packaging> + <version>0.1.0-SNAPSHOT</version> + <name>Apache FreeMarker Generator: Root</name> + <url>https://freemarker.apache.org/</url> + + <issueManagement> + <system>jira</system> + <url>https://issues.apache.org/jira/browse/FREEMARKER/</url> + </issueManagement> + + <mailingLists> + <mailingList> + <name>FreeMarker developer list</name> + <post>[email protected]</post> + <subscribe>[email protected]</subscribe> + <unsubscribe>[email protected]</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/freemarker-dev/</archive> + </mailingList> + <mailingList> + <name>FreeMarker commit and Jira notifications list</name> + <post>[email protected]</post> + <subscribe>[email protected]</subscribe> + <unsubscribe>[email protected]</unsubscribe> + <archive>http://mail-archives.apache.org/mod_mbox/freemarker-notifications/</archive> + </mailingList> + <mailingList> + <name>FreeMarker management private</name> + <post>[email protected]</post> + </mailingList> + </mailingLists> - <name>Freemarker Generator Maven Plugin</name> - <url>http://freemarker.apache.org/</url> + <scm> + <connection>scm:git:https://git-wip-us.apache.org/repos/asf/freemarker-generator.git</connection> + <developerConnection>scm:git:https://git-wip-us.apache.org/repos/asf/freemarker-generator.git</developerConnection> + <url>https://git-wip-us.apache.org/repos/asf?p=freemarker-generator.git</url> + <tag/> + </scm> - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.target>1.8</maven.compiler.target> - <maven-core.version>3.5.2</maven-core.version> - <maven-plugin-api.version>3.5.2</maven-plugin-api.version> - <maven-plugin-annotations.version>3.5</maven-plugin-annotations.version> - <fastutil.version>8.1.0</fastutil.version> - <freemarker.version>2.3.29</freemarker.version> - <gson.version>2.8.6</gson.version> - <jmockit.version>1.32</jmockit.version> - <org.testng.version>6.8</org.testng.version> - <assertj-core.version>3.8.0</assertj-core.version> - <clover-target-percentage>100</clover-target-percentage> - <clover-phase>pre-site</clover-phase> - <target-jdk-version>1.8</target-jdk-version> - </properties> + <modules> + <module>maven-plugin</module> + </modules> - <dependencies> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-core</artifactId> - <version>${maven-core.version}</version> - <scope>provided</scope> - <exclusions> - <exclusion> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - </exclusion> - <exclusion> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-api</artifactId> - <version>${maven-plugin-api.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.maven.plugin-tools</groupId> - <artifactId>maven-plugin-annotations</artifactId> - <version>${maven-plugin-annotations.version}</version> - <scope>provided</scope> - <exclusions> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.eclipse.sisu</groupId> - <artifactId>org.eclipse.sisu.plexus</artifactId> - <version>0.3.3</version> - <exclusions> - <exclusion> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>org.jmockit</groupId> - <artifactId>jmockit</artifactId> - <version>${jmockit.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.google.code.gson</groupId> - <artifactId>gson</artifactId> - <version>${gson.version}</version> - </dependency> - <dependency> - <groupId>org.freemarker</groupId> - <artifactId>freemarker</artifactId> - <version>${freemarker.version}</version> - </dependency> - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>${org.testng.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>${assertj-core.version}</version> - <scope>test</scope> - </dependency> - </dependencies> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <maven.compiler.source>1.8</maven.compiler.source> + <maven.compiler.target>1.8</maven.compiler.target> + <freemarker.version>2.3.29</freemarker.version> + <target-jdk-version>1.8</target-jdk-version> + </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>3.7.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-project-info-reports-plugin</artifactId> - <version>3.0.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.1</version> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-source-plugin</artifactId> - <version>3.2.0</version> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar</goal> - </goals> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-plugin-plugin</artifactId> - <version>3.6.0</version> - <configuration> - <goalPrefix>freemarker</goalPrefix> - </configuration> - <executions> - <execution> - <id>default-descriptor</id> - <goals> - <goal>descriptor</goal> - </goals> - <phase>process-classes</phase> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.openclover</groupId> - <artifactId>clover-maven-plugin</artifactId> - <version>4.2.0</version> - <executions> - <execution> - <id>clover</id> - <phase>${clover-phase}</phase> - <goals> - <goal>instrument-test</goal> - <goal>clover</goal> - <goal>check</goal> - </goals> - <configuration> - <targetPercentage>${clover-target-percentage}</targetPercentage> - <generateHtml>true</generateHtml> - <generateXml>true</generateXml> - <jdk>${target-jdk-version}</jdk> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> -</project> + <build> + <pluginManagement> + <plugins> + <plugin> + <artifactId>maven-clean-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + </plugin> + <plugin> + <artifactId>maven-deploy-plugin</artifactId> + <version>3.0.0-M1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-plugin-plugin</artifactId> + <version>3.6.0</version> + </plugin> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <version>2.5.3</version> + </plugin> + <plugin> + <artifactId>maven-resources-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <version>3.2.0</version> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.19</version> + <configuration> + <useSystemClassLoader>false</useSystemClassLoader> + </configuration> + </plugin> + <plugin> + <groupId>org.openclover</groupId> + <artifactId>clover-maven-plugin</artifactId> + <version>4.2.0</version> + </plugin> + <plugin> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <version>2.2.6</version> + </plugin> + </plugins> + </pluginManagement> + <plugins> + <plugin> + <artifactId>maven-release-plugin</artifactId> + <configuration> + <localCheckout>true</localCheckout> + <pushChanges>false</pushChanges> + <autoVersionSubmodules>true</autoVersionSubmodules> + <arguments>-Dmaven.javadoc.skip=true</arguments> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file
