| | |
| | | * Number of lines to add after the line which contains the lineBeforeCopyrightToken. |
| | | * Used only if a new copyright line is needed. |
| | | */ |
| | | @Parameter(required = true, defaultValue = "2") |
| | | @Parameter(required = true, defaultValue = "1") |
| | | private Integer nbLinesToSkip; |
| | | |
| | | /** |
| | |
| | | * copyright section. Used only if a new copyright or portion copyright is |
| | | * needed. |
| | | */ |
| | | @Parameter(required = true, defaultValue = "6") |
| | | @Parameter(required = true, defaultValue = "1") |
| | | private Integer numberSpaceIdentation; |
| | | |
| | | /** The last non empty commented line before the copyright section. */ |
| | | @Parameter(required = true, defaultValue = "CDDL\\s+HEADER\\s+END") |
| | | @Parameter(required = true, defaultValue = "\\\"Portions Copyright \\[year\\] \\[name of copyright owner\\]\\\"") |
| | | private String lineBeforeCopyrightRegExp; |
| | | |
| | | /** The regular expression which identifies a copyrighted line. */ |
| | |
| | | |
| | | private static final String CURRENT_YEAR = Integer.toString(Calendar.getInstance().get(Calendar.YEAR)); |
| | | private static final String RESOURCE_DIR = "src/test/resources/files/"; |
| | | private static final String[] TEST_FOLDERS = { "openam-copyrights", "opendj-copyrights", "openidm-copyrights"}; |
| | | private static final String[] TEST_FOLDERS = { "forgerock-copyrights", "openidm-copyrights"}; |
| | | |
| | | /** Customs tags in tests files. */ |
| | | private static final String MUST_BE_REMOVED_TAG = "MUST BE REMOVED:"; |
| | |
| | | // New copyright end String |
| | | { TEST_FOLDERS[0], "Portions\\s+Copyright\\s+\\[year\\]\\s+\\[name\\s+of\\s+copyright\\s+owner\\]", |
| | | 1, 1, "Portions copyright", "Copyright", "ForgeRock\\s+AS", "ForgeRock AS." }, |
| | | { TEST_FOLDERS[1], "CDDL\\s+HEADER\\s+END", 1, 6, "Portions Copyright", "Copyright", |
| | | "ForgeRock\\s+AS\\.", "ForgeRock AS." }, |
| | | { TEST_FOLDERS[2], |
| | | { TEST_FOLDERS[1], |
| | | "DO\\s+NOT\\s+ALTER\\s+OR\\s+REMOVE\\s+COPYRIGHT\\s+NOTICES\\s+OR\\s+THIS\\s+HEADER.", 1, 1, |
| | | "Portions Copyrighted", "Copyright (c)", "ForgeRock\\s+AS\\.", |
| | | "ForgeRock AS. All rights reserved." } |
| File was renamed from opendj-sdk/opendj-copyright-maven-plugin/src/test/resources/files/openam-copyrights/openam-bad-copyright-2.txt |
| | |
| | | |
| | | MUST BE REMOVED: Copyright 2010 ForgeRock AS. |
| | | EXPECTED OUTPUT: Copyright 2010-YEAR ForgeRock AS. |
| | | |
| File was renamed from opendj-sdk/opendj-copyright-maven-plugin/src/test/resources/files/openam-copyrights/openam-bad-copyright-3.txt |
| | |
| | | * |
| | | */ |
| | | |
| | | EXPECTED OUTPUT: Copyright YEAR ForgeRock AS. |
| | | EXPECTED OUTPUT: Copyright YEAR ForgeRock AS. |
| File was renamed from opendj-sdk/opendj-copyright-maven-plugin/src/test/resources/files/openam-copyrights/openam-bad-copyright-4.txt |
| | |
| | | * Copyright 2010 Old Copyright Owner Inc. |
| | | */ |
| | | |
| | | EXPECTED OUTPUT: Portions copyright YEAR ForgeRock AS. |
| | | EXPECTED OUTPUT: Portions copyright YEAR ForgeRock AS. |
| File was renamed from opendj-sdk/opendj-copyright-maven-plugin/src/test/resources/files/openam-copyrights/openam-bad-copyright-5.txt |
| | |
| | | * copyright 2013-2014 Old copyright owner Inc. |
| | | */ |
| | | |
| | | EXPECTED OUTPUT: Portions copyright YEAR ForgeRock AS. |
| | | EXPECTED OUTPUT: Portions copyright YEAR ForgeRock AS. |
| File was renamed from opendj-sdk/opendj-copyright-maven-plugin/src/test/resources/files/openam-copyrights/openam-bad-copyright-6.txt |
| | |
| | | */ |
| | | |
| | | MUST BE REMOVED: Portions copyright 2013-2014 ForgeRock AS. |
| | | EXPECTED OUTPUT: Portions copyright 2013-YEAR ForgeRock AS. |
| | | EXPECTED OUTPUT: Portions copyright 2013-YEAR ForgeRock AS. |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!-- |
| | | ! The contents of this file are subject to the terms of the Common Development and |
| | | ! Distribution License (the License). You may not use this file except in compliance with the |
| | | ! License. |
| | | ! |
| | | ! You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the |
| | | ! specific language governing permission and limitations under the License. |
| | | ! |
| | | ! When distributing Covered Software, include this CDDL Header Notice in each file and include |
| | | ! the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL |
| | | ! Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | ! information: "Portions Copyright [year] [name of copyright owner]". |
| | | ! |
| | | ! Copyright 2012-2014 ForgeRock AS. |
| | | --> |
| | | |
| | | MUST BE REMOVED: Copyright 2012-2014 ForgeRock AS. |
| | | EXPECTED OUTPUT: Copyright 2012-YEAR ForgeRock AS. |
| New file |
| | |
| | | <!-- |
| | | The contents of this file are subject to the terms of the Common Development and |
| | | Distribution License (the License). You may not use this file except in compliance with the |
| | | License. |
| | | |
| | | You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the |
| | | specific language governing permission and limitations under the License. |
| | | |
| | | When distributing Covered Software, include this CDDL Header Notice in each file and include |
| | | the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL |
| | | Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | information: "Portions Copyright [year] [name of copyright owner]". |
| | | |
| | | Copyright 2013 ForgeRock AS. |
| | | --> |
| | | |
| | | MUST BE REMOVED: Copyright 2013 ForgeRock AS. |
| | | EXPECTED OUTPUT: Copyright 2013-YEAR ForgeRock AS. |
| New file |
| | |
| | | <!-- |
| | | ~ The contents of this file are subject to the terms of the Common Development and |
| | | ~ Distribution License (the License). You may not use this file except in compliance with the |
| | | ~ License. |
| | | ~ |
| | | ~ You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the |
| | | ~ specific language governing permission and limitations under the License. |
| | | ~ |
| | | ~ When distributing Covered Software, include this CDDL Header Notice in each file and include |
| | | ~ the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL |
| | | ~ Header, with the fields enclosed by brackets [] replaced by your own identifying |
| | | ~ information: "Portions Copyright [year] [name of copyright owner]". |
| | | ~ |
| | | --> |
| | | |
| | | EXPECTED OUTPUT: Copyright YEAR ForgeRock AS. |
| | |
| | | <goals> |
| | | <goal>update-copyright</goal> |
| | | </goals> |
| | | <configuration> |
| | | <!-- We need to accept the second part of the following regular |
| | | ! expression for submodules: |
| | | ! * opendj-rest2ldap |
| | | ! |
| | | ! Please note that the regexp |
| | | ! '\"Portions Copyright \[year\] \[name of copyright owner\]\"' |
| | | ! must never be found before 'CDDL HEADER END' in other submodules, |
| | | ! otherwise the plugin will fail. |
| | | --> |
| | | <lineBeforeCopyrightRegExp> |
| | | (CDDL HEADER END|\"Portions Copyright \[year\] \[name of copyright owner\]\") |
| | | </lineBeforeCopyrightRegExp> |
| | | </configuration> |
| | | </execution> |
| | | </executions> |
| | | </plugin> |