From 4d14e14c4268ac0abccf0d614fb3e59f42abc767 Mon Sep 17 00:00:00 2001 From: Bertrand Renuart Date: Tue, 6 Jul 2021 11:11:46 +0200 Subject: [PATCH] Update to license-maven-plugin:4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update POM to use the latest version of the Mycila license plugin (and correct GAV). Move plugin configuration inside the section so the plugin can be manually invoked from the command line. Particularly handy to fix header issues automatically… Change the build process to “check” the files only and fail the build if not valid. Related issue: #549 --- CONTRIBUTING.md | 34 +++++++++++++++++++++++++++++++++- pom.xml | 37 ++++++++++++++++++++----------------- 2 files changed, 53 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3cfd50e3..11fdbc27 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -98,12 +98,44 @@ Source Code Style ----------------- Please follow the style used by the existing code in the repository. - Rules are enforced by [checkstyle](src/checkstyle/checkstyle.xml). +Java source files must include the following header at the top of the file, before the _package_ declaration: + +``` +/** + * 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 project makes use of the great https://github.com/mathieucarbou/license-maven-plugin[Mycila Maven License Plugin] to check for the presence of a valid header in source files during the build process. + +You can manually check your source files by invoking the plugin manually on the command line as follows: + +``` +mvn license:check +``` + +You can also ask the plugin to automatically update the header for you like this: + +``` +mvn license:format +``` + License ------- By contributing, you agree that the contributions will be licensed under the [Apache License 2.0](https://github.com/logstash/logstash-logback-encoder/blob/main/LICENSE). + diff --git a/pom.xml b/pom.xml index e54f9382..ceeb7b59 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 3.0.1 3.2.0 3.3.0 - 1.9.0 + 4.1 2.5.3 3.2.4 3.2.1 @@ -268,26 +268,13 @@ ${maven-release-plugin.version} - com.mycila.maven-license-plugin - maven-license-plugin - ${maven-license-plugin.version} - -
license-header.txt
- true - true - UTF-8 - true - true - - **/src/main/java/** - **/src/test/java/** - -
+ com.mycila + license-maven-plugin process-sources - format + check @@ -421,6 +408,22 @@
+ + com.mycila + license-maven-plugin + ${license-maven-plugin.version} + +
license-header.txt
+ + JAVADOC_STYLE + + + src/main/java/** + src/test/java/** + +
+
+