Skip to content

Commit 781d712

Browse files
committed
Adding license plugin to reformat license headers when 'formatting' profile is activated.
1 parent f9b6ad9 commit 781d712

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

pom.xml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!--
2+
3+
Copyright (C) 2012 John Casey (jdcasey@commonjava.org)
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
17+
-->
118
<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">
219
<modelVersion>4.0.0</modelVersion>
320

@@ -11,10 +28,12 @@
1128
<url>http://github.com/jdcasey/commonjava</url>
1229

1330
<description>CommonJava top-level parent POM.</description>
31+
<inceptionYear>2012</inceptionYear>
1432

1533
<licenses>
1634
<license>
17-
<name>GPLv3.0</name>
35+
<name>Apache License, Version 2.0</name>
36+
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
1837
<distribution>repo</distribution>
1938
</license>
2039
</licenses>
@@ -35,6 +54,7 @@
3554
</scm>
3655

3756
<properties>
57+
<projectOwner>John Casey</projectOwner>
3858
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3959
<version.plugin.compiler>3.1</version.plugin.compiler>
4060
<version.plugin.plugin>3.2</version.plugin.plugin>
@@ -219,6 +239,11 @@
219239
<artifactId>maven-jar-plugin</artifactId>
220240
<version>${version.plugin.jar}</version>
221241
</plugin>
242+
<plugin>
243+
<groupId>com.mycila</groupId>
244+
<artifactId>license-maven-plugin</artifactId>
245+
<version>2.10</version>
246+
</plugin>
222247

223248
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
224249
<plugin>
@@ -255,6 +280,37 @@
255280
</build>
256281

257282
<profiles>
283+
<profile>
284+
<id>formatting</id>
285+
<build>
286+
<plugins>
287+
<plugin>
288+
<groupId>com.mycila</groupId>
289+
<artifactId>license-maven-plugin</artifactId>
290+
<configuration>
291+
<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
292+
<properties>
293+
<owner>${projectOwner}</owner>
294+
<email>jdcasey@commonjava.org</email>
295+
</properties>
296+
<excludes>
297+
<exclude>**/README</exclude>
298+
<exclude>src/test/resources/**</exclude>
299+
<exclude>src/main/resources/**</exclude>
300+
</excludes>
301+
</configuration>
302+
<executions>
303+
<execution>
304+
<phase>process-sources</phase>
305+
<goals>
306+
<goal>format</goal>
307+
</goals>
308+
</execution>
309+
</executions>
310+
</plugin>
311+
</plugins>
312+
</build>
313+
</profile>
258314
<profile>
259315
<id>release</id>
260316
<build>

0 commit comments

Comments
 (0)