mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Gaetan Boismal
06.34.2015 01142026fe0d83f2113da46c9bd6798c06f7da84
Improve copyright maven plugin

Add the possibility to skip check and/or update copyrights for some
files.
Disable copyright checks and update on README and legal files.
2 files modified
26 ■■■■■ changed files
opendj-sdk/opendj-copyright-maven-plugin/src/main/java/org/forgerock/maven/CopyrightAbstractMojo.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/pom.xml 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-copyright-maven-plugin/src/main/java/org/forgerock/maven/CopyrightAbstractMojo.java
@@ -90,6 +90,10 @@
    @Parameter(required = true, defaultValue = "${project.scm.connection}")
    private String scmRepositoryUrl;
    /**
     * List of file patterns for which copyright check and/or update will be skipped.
     * Pattern can contain the following wildcards (*, ?, **{@literal /}).
     */
    @Parameter(required = false)
    private List<String> disabledFiles;
@@ -254,7 +258,16 @@
    }
    private boolean fileIsDisabled(final String scmFilePath) {
        return disabledFiles != null && disabledFiles.contains(scmFilePath);
        if (disabledFiles == null) {
            return false;
        }
        for (final String disableFile : disabledFiles) {
            String regexp = disableFile.replace("**/", "(.+/)+").replace("?", ".?").replace("*", ".*?");
            if (scmFilePath.matches(regexp)) {
                return true;
            }
        }
        return false;
    }
    /** Examines the provided files list to determine whether each changed file copyright is acceptable. */
opendj-sdk/pom.xml
@@ -163,6 +163,17 @@
                    <groupId>org.forgerock.opendj</groupId>
                    <artifactId>opendj-copyright-maven-plugin</artifactId>
                    <version>${project.version}</version>
                    <configuration>
                        <!-- Disable copyright on README and legal files -->
                        <disabledFiles>
                            <disabledFile>README</disabledFile>
                            <disabledFile>**/README</disabledFile>
                            <disabledFile>README.txt</disabledFile>
                            <disabledFile>**/README.txt</disabledFile>
                            <disabledFile>**/THIRDPARTYREADME.txt</disabledFile>
                            <disabledFile>legal-notices/CDDLv1_0.txt</disabledFile>
                        </disabledFiles>
                    </configuration>
                </plugin>
                <plugin>