Added licene-maven-plugin to build

The plugin adds basic checks for license headers. At
this stage we only enable checks for java source files.
Other files are omitted at this point.
This commit is contained in:
mrsolo 2014-01-09 13:44:04 -08:00 committed by Simon Willnauer
parent be2d02492e
commit 2df42e4460
3 changed files with 63 additions and 1 deletions

View File

@ -0,0 +1,16 @@
Licensed to Elasticsearch under one or more contributor
license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright
ownership. Elasticsearch licenses this file to you 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.

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<additionalHeaders>
<javadoc_style>
<firstLine>/*</firstLine>
<beforeEachLine> * </beforeEachLine>
<endLine> */</endLine>
<!--skipLine></skipLine-->
<firstLineDetectionPattern>(\s|\t)*/\*.*$</firstLineDetectionPattern>
<lastLineDetectionPattern>.*\*/(\s|\t)*$</lastLineDetectionPattern>
<allowBlankLines>false</allowBlankLines>
<isMultiline>true</isMultiline>
</javadoc_style>
</additionalHeaders>

33
pom.xml
View File

@ -1073,6 +1073,39 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>2.5</version>
<configuration>
<header>dev-tools/elasticsearch_license_header.txt</header>
<headerDefinitions>
<headerDefinition>dev-tools/license_header_definition.xml</headerDefinition>
</headerDefinitions>
<includes>
<include>src/main/java/org/elasticsearch/**/*.java</include>
<include>src/test/java/org/elasticsearch/**/*.java</include>
</includes>
<excludes>
<exclude>src/main/java/org/elasticsearch/common/inject/**</exclude> <!-- Guice -->
<exclude>src/main/java/org/elasticsearch/common/geo/GeoHashUtils.java</exclude>
<exclude>src/main/java/org/elasticsearch/common/lucene/search/XBooleanFilter.java</exclude>
<exclude>src/main/java/org/elasticsearch/common/lucene/search/XFilteredQuery.java</exclude>
<exclude>src/main/java/org/apache/lucene/queryparser/XSimpleQueryParser.java</exclude>
<exclude>src/main/java/org/apache/lucene/**/X*.java</exclude>
</excludes>
</configuration>
<!-- We can't run by default since the package is broken with java 1.6
see https://github.com/mycila/license-maven-plugin/issues/35
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
-->
</plugin>
</plugins>
<pluginManagement>
<plugins>