-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#517: optionally support copyright values that only contain inception…
… year rather than year range
- Loading branch information
1 parent
cac0569
commit 4741105
Showing
7 changed files
with
197 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Integration test for issue #517 | ||
|
||
## description | ||
|
||
Verify that the copyright statement format can be restricted to use inception year only |
23 changes: 23 additions & 0 deletions
23
src/it/inception-year-only-copyright-format/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
### | ||
# #%L | ||
# License Maven Plugin | ||
# %% | ||
# Copyright (C) 2008 - 2020 CodeLutin, Codehaus, Tony Chemit | ||
# %% | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Lesser General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Lesser Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Lesser Public | ||
# License along with this program. If not, see | ||
# <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
# #L% | ||
### | ||
invoker.goals=clean package | ||
invoker.failureBehavior=fail-fast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<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.codehaus.mojo.license.test</groupId> | ||
<artifactId>test-inception-year-only-copyright-format</artifactId> | ||
<version>1.0</version> | ||
<name>License Test :: inception-year-only-copyright-format</name> | ||
<packaging>jar</packaging> | ||
|
||
<organization> | ||
<name>org.example</name> | ||
</organization> | ||
|
||
<inceptionYear>2023</inceptionYear> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<build> | ||
|
||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>@maven-compiler-plugin.version@</version> | ||
<configuration> | ||
<source>1.8</source> | ||
<target>1.8</target> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>build-helper-maven-plugin</artifactId> | ||
<version>@build-helper-maven-plugin.version@</version> | ||
<executions> | ||
<execution> | ||
<id>add-generated-source-directory</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>add-source</goal> | ||
</goals> | ||
<configuration> | ||
<sources> | ||
<source>${project.build.directory}/generated-sources</source> | ||
</sources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>@maven-resources-plugin.version@</version> | ||
|
||
<executions> | ||
<execution> | ||
<id>generate-sources</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>copy-resources</goal> | ||
</goals> | ||
<configuration> | ||
|
||
<outputDirectory>${project.build.directory}/generated-sources</outputDirectory> | ||
|
||
<resources> | ||
<resource> | ||
<directory>src/main/original/java</directory> | ||
<filtering>false</filtering> | ||
<include>**/*.java</include> | ||
</resource> | ||
</resources> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>license-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
|
||
<executions> | ||
<execution> | ||
<phase>process-sources</phase> | ||
<goals> | ||
<goal>update-file-header</goal> | ||
</goals> | ||
<configuration> | ||
|
||
<encoding>UTF-8</encoding> | ||
<roots> | ||
<root>${project.build.directory}/generated-sources</root> | ||
</roots> | ||
|
||
<ignoreLastDate>true</ignoreLastDate> | ||
|
||
<licenseName>lgpl_v3</licenseName> | ||
|
||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
29 changes: 29 additions & 0 deletions
29
src/it/inception-year-only-copyright-format/postbuild.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* #%L | ||
* License Maven Plugin | ||
* %% | ||
* Copyright (C) 2008 - 2020 CodeLutin, Codehaus, Tony Chemit | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Lesser Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Lesser Public | ||
* License along with this program. If not, see | ||
* <http://www.gnu.org/licenses/lgpl-3.0.html>. | ||
* #L% | ||
*/ | ||
|
||
file = new File(basedir, 'target/generated-sources/org/example/test/SampleFile.java'); | ||
assert file.exists(); | ||
content = file.text; | ||
|
||
assert content.contains('Copyright (C) 2023 org.example'); | ||
|
||
return true; |
10 changes: 10 additions & 0 deletions
10
...eption-year-only-copyright-format/src/main/original/java/org/example/test/SampleFile.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.example.test; | ||
import java.io.File; | ||
|
||
|
||
public class SampleFile { | ||
public static void main(String[] args) { | ||
File file = new File(args[0]); | ||
System.out.println(file.getAbsolutePath()); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...tion-year-only-copyright-format/src/main/original/java/org/example/test/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@Deprecated | ||
package org.example.test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters