From 2c1e298ff1e2045777fcb5c4da6e8186fadb4b58 Mon Sep 17 00:00:00 2001 From: Tony Chemit Date: Thu, 17 May 2012 18:36:17 +0000 Subject: [PATCH 1/3] [maven-release-plugin] prepare for next development iteration git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/license-maven-plugin@16638 52ab4f32-60fc-0310-b215-8acea882cd1b --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 742311a75..7f3e1c0ba 100644 --- a/pom.xml +++ b/pom.xml @@ -33,13 +33,13 @@ license-maven-plugin maven-plugin License Maven Plugin - 1.1 + 1.2-SNAPSHOT Maven plugin to download and collect license files from project dependencies. - scm:svn:http://svn.codehaus.org/mojo/tags/license-maven-plugin-1.1 - scm:svn:https://svn.codehaus.org/mojo/tags/license-maven-plugin-1.1 - http://fisheye.codehaus.org/browse/mojo/tags/license-maven-plugin-1.1 + scm:svn:http://svn.codehaus.org/mojo/trunk/mojo/license-maven-plugin + scm:svn:https://svn.codehaus.org/mojo/trunk/mojo/license-maven-plugin + http://fisheye.codehaus.org/browse/mojo/trunk/mojo/license-maven-plugin From 58bf2fa3bdfc07d7e28640e34167da9c1f3f27ce Mon Sep 17 00:00:00 2001 From: Tony Chemit Date: Thu, 17 May 2012 22:44:37 +0000 Subject: [PATCH 2/3] back to version 1.1 MLICENSE-38 Fix PMD, CPD and some checkstyle (license header for example). git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/license-maven-plugin@16640 52ab4f32-60fc-0310-b215-8acea882cd1b --- config/checkstyle-header.txt | 23 ++++ pom.xml | 12 +- .../add-third-party/MLICENSE-2/child1/pom.xml | 3 - .../add-third-party/MLICENSE-2/child2/pom.xml | 3 - .../MLICENSE-2/invoker.properties | 3 - src/it/add-third-party/MLICENSE-2/pom.xml | 3 - .../MLICENSE-2/postbuild.groovy | 3 - .../MLICENSE-21/child1/pom.xml | 3 - .../MLICENSE-21/child2/pom.xml | 3 - .../MLICENSE-21/invoker.properties | 3 - src/it/add-third-party/MLICENSE-21/pom.xml | 3 - .../MLICENSE-21/postbuild.groovy | 3 - .../MLICENSE-23/invoker.properties | 3 - src/it/add-third-party/MLICENSE-23/pom.xml | 3 - .../MLICENSE-25/invoker.properties | 3 - src/it/add-third-party/MLICENSE-25/pom.xml | 3 - .../MLICENSE-25/postbuild.groovy | 22 ++++ src/it/add-third-party/MLICENSE-36/pom.xml | 3 - .../MLICENSE-36/postbuild.groovy | 3 - .../blacklist-fail/invoker.properties | 5 +- .../MLICENSE-37/blacklist-fail/pom.xml | 5 +- .../blacklist-fail/postbuild.groovy | 22 ++++ .../blacklist-success/invoker.properties | 5 +- .../MLICENSE-37/blacklist-success/pom.xml | 5 +- .../blacklist-success/postbuild.groovy | 21 ++++ .../whitelist-fail/invoker.properties | 5 +- .../MLICENSE-37/whitelist-fail/pom.xml | 5 +- .../whitelist-fail/postbuild.groovy | 22 ++++ .../whitelist-success/invoker.properties | 5 +- .../MLICENSE-37/whitelist-success/pom.xml | 5 +- .../whitelist-success/postbuild.groovy | 21 ++++ .../excluded-included/invoker.properties | 3 - .../add-third-party/excluded-included/pom.xml | 3 - .../excluded-included/postbuild.groovy | 3 - .../merge-licenses/invoker.properties | 3 - src/it/add-third-party/merge-licenses/pom.xml | 3 - .../merge-licenses/postbuild.groovy | 3 - .../missing-pom/invoker.properties | 5 +- src/it/add-third-party/missing-pom/pom.xml | 5 +- .../missing-pom/postbuild.groovy | 5 +- .../no-deps/invoker.properties | 3 - src/it/add-third-party/no-deps/pom.xml | 3 - .../add-third-party/no-deps/postbuild.groovy | 3 - .../no-encoding/invoker.properties | 3 - src/it/add-third-party/no-encoding/pom.xml | 3 - .../no-encoding/postbuild.groovy | 3 - .../with-deps/invoker.properties | 3 - src/it/add-third-party/with-deps/pom.xml | 3 - .../with-deps/postbuild.groovy | 3 - .../bad-license/child1/pom.xml | 3 - .../bad-license/child2/pom.xml | 3 - .../bad-license/invoker.properties | 3 - .../bad-license/pom.xml | 3 - .../bad-license/postbuild.groovy | 3 - .../multimodule-filters/child1/pom.xml | 3 - .../multimodule-filters/child2/pom.xml | 3 - .../multimodule-filters/invoker.properties | 3 - .../multimodule-filters/pom.xml | 3 - .../multimodule-filters/postbuild.groovy | 3 - .../simple/child1/pom.xml | 3 - .../simple/child2/pom.xml | 3 - .../simple/invoker.properties | 3 - .../aggregate-add-third-party/simple/pom.xml | 3 - .../simple/postbuild.groovy | 3 - src/it/settings.xml | 3 - .../MLICENSE-33/postbuild.groovy | 21 ++++ src/it/update-file-header/MLICENSE-27/pom.xml | 3 - .../MLICENSE-27/postbuild.groovy | 3 - .../MLICENSE-3/invoker.properties | 3 - src/it/update-file-header/MLICENSE-3/pom.xml | 3 - .../MLICENSE-3/postbuild.groovy | 3 - src/it/update-file-header/MLICENSE-30/pom.xml | 3 - .../MLICENSE-30/postbuild.groovy | 3 - .../test-mojo/child1/pom.xml | 3 - .../test-mojo/invoker.properties | 3 - src/it/update-file-header/test-mojo/pom.xml | 3 - .../test-mojo/postbuild.groovy | 3 - .../MLICENSE-5/invoker.properties | 3 - .../update-project-license/MLICENSE-5/pom.xml | 3 - .../MLICENSE-5/postbuild.groovy | 3 - .../test-mojo/invoker.properties | 3 - .../update-project-license/test-mojo/pom.xml | 3 - .../test-mojo/postbuild.groovy | 3 - .../license/AbstractAddThirdPartyMojo.java | 28 ++--- .../mojo/license/AbstractLicenseMojo.java | 4 +- .../mojo/license/AbstractLicenseNameMojo.java | 5 +- .../license/AbstractLicenseReportMojo.java | 6 +- .../AbstractLicenseReportRenderer.java | 4 +- .../mojo/license/AddThirdPartyMojo.java | 24 ++-- .../license/AggregatorAddThirdPartyMojo.java | 4 +- .../mojo/license/CommentStyleListMojo.java | 4 +- .../mojo/license/DownloadLicensesMojo.java | 8 +- .../mojo/license/LicenseListMojo.java | 4 +- .../mojo/license/ThirdPartyReportMojo.java | 14 +-- .../license/ThirdPartyReportRenderer.java | 15 +-- .../mojo/license/UpdateFileHeaderMojo.java | 80 +++++++------- .../license/UpdateProjectLicenseMojo.java | 8 +- .../license/api/DefaultDependenciesTool.java | 35 ++++-- .../license/api/DefaultThirdPartyDetails.java | 4 +- .../license/api/DefaultThirdPartyHelper.java | 32 +++++- .../license/api/DefaultThirdPartyTool.java | 36 +++--- .../mojo/license/api/DependenciesTool.java | 3 +- .../mojo/license/api/FreeMarkerHelper.java | 35 ++++-- .../MavenProjectDependenciesConfigurator.java | 9 +- .../mojo/license/api/ThirdPartyDetails.java | 4 +- .../mojo/license/api/ThirdPartyHelper.java | 4 +- .../mojo/license/api/ThirdPartyTool.java | 5 +- .../license/api/ThirdPartyToolException.java | 3 +- .../mojo/license/header/FileHeader.java | 6 +- .../mojo/license/header/FileHeaderFilter.java | 43 ++++++-- .../license/header/FileHeaderProcessor.java | 13 +-- .../FileHeaderProcessorConfiguration.java | 4 +- .../header/InvalideFileHeaderException.java | 12 +- .../header/UpdateFileHeaderFilter.java | 11 +- .../AbstractFileHeaderTransformer.java | 104 +++++++++++++++--- .../transformer/AptFileHeaderTransformer.java | 24 ++-- .../transformer/FileHeaderTransformer.java | 28 +++-- .../FreeMarkerFileHeaderTransformer.java | 24 ++-- .../JavaFileHeaderTransformer.java | 24 ++-- .../transformer/JspFileHeaderTransformer.java | 22 ++-- .../transformer/PhpFileHeaderTransformer.java | 23 ++-- .../PropertiesFileHeaderTransformer.java | 30 ++--- .../transformer/RstFileHeaderTransformer.java | 24 ++-- .../transformer/SqlFileHeaderTransformer.java | 22 ++-- .../transformer/XmlFileHeaderTransformer.java | 25 ++--- .../codehaus/mojo/license/model/License.java | 17 ++- .../mojo/license/model/LicenseMap.java | 3 +- .../mojo/license/model/LicenseRepository.java | 12 +- .../mojo/license/model/LicenseStore.java | 17 +-- .../license/model/ProjectLicenseInfo.java | 8 +- .../codehaus/mojo/license/utils/FileUtil.java | 8 +- .../mojo/license/utils/LicenseDownloader.java | 3 +- .../license/utils/LicenseSummaryReader.java | 3 +- .../license/utils/LicenseSummaryWriter.java | 3 +- .../mojo/license/utils/MojoHelper.java | 22 ++-- .../mojo/license/utils/SortedProperties.java | 7 +- .../META-INF/licenses/licenses.properties | 3 - src/main/resources/log4j.properties | 3 - .../default-file-header-description.ftl | 21 ++++ .../org/codehaus/mojo/license/licenses.xsd | 32 +++--- .../third-party-file-groupByLicense.ftl | 21 ++++ .../mojo/license/third-party-file.ftl | 51 ++++++--- .../resources/third-party-report.properties | 1 - .../third-party-report_en.properties | 1 - .../third-party-report_fr.properties | 1 - src/site/apt/examples/example-add-license.apt | 3 - .../example-comment-style-list.apt.vm | 22 ++++ .../examples/example-download-licenses.apt.vm | 22 ++++ .../apt/examples/example-license-list.apt.vm | 22 ++++ .../apt/examples/example-thirdparty.apt.vm | 22 ++++ .../examples/update-file-header-config.apt.vm | 3 - src/site/apt/header.apt | 3 - src/site/apt/index.apt.vm | 24 +++- src/site/apt/usage.apt.vm | 22 ++++ src/site/fml/faq.fml | 33 +++--- src/site/site.xml | 33 +++--- .../license/api/FreeMarkerHelperTest.java | 35 ++++-- .../AbstractFileHeaderTransformerTest.java | 50 ++++----- .../XmlFileHeaderTransformerTest.java | 6 +- .../license/model/LicenseRepositoryTest.java | 7 +- .../mojo/license/model/LicenseStoreTest.java | 7 +- .../license/utils/LicenseSummaryTest.java | 6 +- src/test/resources/license-summary-test.xml | 4 - src/test/resources/log4j.properties | 3 - 164 files changed, 1022 insertions(+), 770 deletions(-) create mode 100644 config/checkstyle-header.txt diff --git a/config/checkstyle-header.txt b/config/checkstyle-header.txt new file mode 100644 index 000000000..4cf20381a --- /dev/null +++ b/config/checkstyle-header.txt @@ -0,0 +1,23 @@ +^package +^\s*$ +^/\*\s*$ +^ \* #%L\s*$ +^ \* License Maven Plugin\s*$ +^ \* %%\s*$ +^ \* Copyright \(C\).*$ +^ \* %%\s*$ +^ \* This program is free software: you can redistribute it and/or modify\s*$ +^ \* it under the terms of the GNU Lesser General Public License as\s*$ +^ \* published by the Free Software Foundation, either version 3 of the\s*$ +^ \* License, or \(at your option\) any later version.\s*$ +^ \*\s*$ +^ \* This program is distributed in the hope that it will be useful,\s*$ +^ \* but WITHOUT ANY WARRANTY; without even the implied warranty of\s*$ +^ \* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\s*$ +^ \* GNU General Lesser Public License for more details.\s*$ +^ \*\s*$ +^ \* You should have received a copy of the GNU General Lesser Public\s*$ +^ \* License along with this program. If not, see\s*$ +^ \* .\s*$ +^ \* #L%\s*$ +^ \*/\s*$ \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7f3e1c0ba..f1bb67f7b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ #%L License Maven Plugin %% - Copyright (C) 2011-2012 CodeLutin, Codehaus + Copyright (C) 2011-2012 CodeLutin, Codehaus, tony Chzemit %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -33,7 +33,7 @@ license-maven-plugin maven-plugin License Maven Plugin - 1.2-SNAPSHOT + 1.1-SNAPSHOT Maven plugin to download and collect license files from project dependencies. @@ -387,6 +387,14 @@ 1.5 + + maven-checkstyle-plugin + + config/checkstyle-header.txt + + + + "; - + /** + * Default constructor. + */ public FreeMarkerFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "ftl", "header transformer with free marker comment style", "<#--", "-->", " " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME }; + return new String[]{ "ftl" }; } } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/JavaFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/JavaFileHeaderTransformer.java index 32c352224..523f7620a 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/JavaFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/JavaFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.header.transformer; - /** * Implementation of {@link FileHeaderTransformer} for java format. * @@ -33,24 +33,20 @@ public class JavaFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "java"; - - public static final String DESCRIPTION = "header transformer with java comment style"; - - public static final String COMMENT_LINE_PREFIX = " * "; - - public static final String COMMENT_START_TAG = "/*"; - - public static final String COMMENT_END_TAG = " */"; - + /** + * Default constructor. + */ public JavaFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "java", "header transformer with java comment style", "/*", " */", " * " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME, "groovy", "css", "cs", "as", "aj", "c", "h", "cpp", "js", "json" + return new String[]{ "java", "groovy", "css", "cs", "as", "aj", "c", "h", "cpp", "js", "json" }; } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/JspFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/JspFileHeaderTransformer.java index 5d73719ec..d27d696ce 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/JspFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/JspFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.header.transformer; /** * Implementation of {@link FileHeaderTransformer} for jsp format. @@ -31,24 +32,21 @@ public class JspFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "jsp"; - - public static final String DESCRIPTION = "header transformer with jsp comment style"; - - public static final String COMMENT_LINE_PREFIX = " "; - - public static final String COMMENT_START_TAG = "<%--"; - - public static final String COMMENT_END_TAG = " --%>"; + /** + * Default constructor. + */ public JspFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "jsp", "header transformer with jsp comment style", "<%--", " --%>", " " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME, "jspx" }; + return new String[]{ "jsp", "jspx" }; } } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/PhpFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/PhpFileHeaderTransformer.java index cffebf426..09a49695a 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/PhpFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/PhpFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.header.transformer; /** * Implementation of {@link FileHeaderTransformer} for PHP format. @@ -33,24 +34,20 @@ public class PhpFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "php"; - - public static final String DESCRIPTION = "header transformer with php comment style"; - - public static final String COMMENT_LINE_PREFIX = " * "; - - public static final String COMMENT_START_TAG = ""; - + /** + * Default constructor. + */ public PhpFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "php", "header transformer with php comment style", "", " * " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME }; + return new String[]{ "php" }; } } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/PropertiesFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/PropertiesFileHeaderTransformer.java index cfd886c9c..9300ca0fa 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/PropertiesFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/PropertiesFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.header.transformer; - /** * Implementation of {@link FileHeaderTransformer} for properties format. * @@ -33,29 +33,31 @@ public class PropertiesFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "properties"; - - public static final String DESCRIPTION = "header transformer with properties file comment style"; - - public static final String COMMENT_LINE_PREFIX = "# "; - - public static final String COMMENT_START_TAG = "###"; - - public static final String COMMENT_END_TAG = "###"; - + /** + * Line separator caracter. + */ protected final String linesep; + /** + * Default constructor. + */ public PropertiesFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "properties", "header transformer with properties file comment style", "###", "###", "# " ); linesep = System.getProperty( "line.separator" ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME, "sh", "py", "rb", "pl", "pm" }; + return new String[]{ "properties", "sh", "py", "rb", "pl", "pm" }; } + /** + * {@inheritDoc} + */ @Override public String addHeader( String header, String content ) { diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/RstFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/RstFileHeaderTransformer.java index 572035e89..c2696fa7d 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/RstFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/RstFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.header.transformer; - /** * Implementation of {@link FileHeaderTransformer} for apt format. * @@ -33,23 +33,19 @@ public class RstFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "rst"; - - public static final String DESCRIPTION = "header transformer with rst comment style"; - - public static final String COMMENT_LINE_PREFIX = ".. * "; - - public static final String COMMENT_START_TAG = ".. -"; - - public static final String COMMENT_END_TAG = ".. -"; - + /** + * Default constructor. + */ public RstFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "rst", "header transformer with rst comment style", ".. -", ".. -", ".. * " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME }; + return new String[]{ "rst" }; } } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/SqlFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/SqlFileHeaderTransformer.java index 612204d2b..8cedb3ea0 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/SqlFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/SqlFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.header.transformer; /** * Implementation of {@link FileHeaderTransformer} for sql format. @@ -31,23 +32,20 @@ public class SqlFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "sql"; - - public static final String DESCRIPTION = "header transformer with sql comment style"; - - public static final String COMMENT_LINE_PREFIX = "-- "; - - public static final String COMMENT_START_TAG = "---"; - - public static final String COMMENT_END_TAG = "---"; + /** + * Default constructor. + */ public SqlFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "sql", "header transformer with sql comment style", "---", "---", "-- " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { - return new String[]{ NAME }; + return new String[]{ "sql" }; } } diff --git a/src/main/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformer.java b/src/main/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformer.java index 0178b8b4c..b7b0c3002 100644 --- a/src/main/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformer.java +++ b/src/main/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformer.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.header.transformer; - /** * Implementation of {@link FileHeaderTransformer} for xml format. * @@ -33,27 +33,26 @@ public class XmlFileHeaderTransformer extends AbstractFileHeaderTransformer { - public static final String NAME = "xml"; - - public static final String DESCRIPTION = "header transformer with xml comment style"; - - public static final String COMMENT_LINE_PREFIX = " "; - - public static final String COMMENT_START_TAG = ""; - + /** + * Default constructor. + */ public XmlFileHeaderTransformer() { - super( NAME, DESCRIPTION, COMMENT_START_TAG, COMMENT_END_TAG, COMMENT_LINE_PREFIX ); + super( "xml", "header transformer with xml comment style", "", " " ); } + /** + * {@inheritDoc} + */ public String[] getDefaultAcceptedExtensions() { return new String[]{ "pom", "xml", "xhtml", "mxlm", "dtd", "fml", "xsl", "html", "htm", "jaxx", "kml", "gsp", "tml" }; } + /** + * {@inheritDoc} + */ @Override public String addHeader( String header, String content ) { diff --git a/src/main/java/org/codehaus/mojo/license/model/License.java b/src/main/java/org/codehaus/mojo/license/model/License.java index 7bc6ade67..dd32ae744 100644 --- a/src/main/java/org/codehaus/mojo/license/model/License.java +++ b/src/main/java/org/codehaus/mojo/license/model/License.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -23,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.model; - import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; import org.codehaus.mojo.license.utils.MojoHelper; @@ -50,27 +47,27 @@ public class License public static final String LICENSE_CONTENT_FILE = "license.txt"; /** - * base url of license (directory where to find license files) + * base url of license (directory where to find license files). */ protected URL baseURL; /** - * the name of the licenses (ex lgpl-3.0) + * the name of the licenses (ex lgpl-3.0). */ protected String name; /** - * the description of the license + * the description of the license. */ protected String description; /** - * url of the license's content + * url of the license's content. */ protected URL licenseURL; /** - * url of the license header's content + * url of the license header's content. */ protected URL headerURL; diff --git a/src/main/java/org/codehaus/mojo/license/model/LicenseMap.java b/src/main/java/org/codehaus/mojo/license/model/LicenseMap.java index 73d95a6aa..e5e68077e 100644 --- a/src/main/java/org/codehaus/mojo/license/model/LicenseMap.java +++ b/src/main/java/org/codehaus/mojo/license/model/LicenseMap.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.model; import org.apache.maven.project.MavenProject; import org.codehaus.mojo.license.utils.MojoHelper; diff --git a/src/main/java/org/codehaus/mojo/license/model/LicenseRepository.java b/src/main/java/org/codehaus/mojo/license/model/LicenseRepository.java index 23d290004..166cd8f52 100644 --- a/src/main/java/org/codehaus/mojo/license/model/LicenseRepository.java +++ b/src/main/java/org/codehaus/mojo/license/model/LicenseRepository.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.model; - import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -48,7 +48,7 @@ public class LicenseRepository { /** - * Logger + * Logger. */ private static final Log LOG = LogFactory.getLog( LicenseRepository.class ); @@ -58,12 +58,12 @@ public class LicenseRepository Pattern.compile( "(.*)\\s*~~\\s*license\\s*:\\s*(.*)\\s*~~\\s*header\\s*:\\s*(.*)\\s*" ); /** - * the base url of the licenses repository + * the base url of the licenses repository. */ protected URL baseURL; /** - * licenses of this repository + * licenses of this repository. */ protected List licenses; @@ -238,7 +238,6 @@ protected boolean checkExists( URL url ) } protected void checkInit( String operation ) - throws IllegalStateException { if ( !init ) { @@ -248,7 +247,6 @@ protected void checkInit( String operation ) } protected void checkNotInit( String operation ) - throws IllegalStateException { if ( init ) { diff --git a/src/main/java/org/codehaus/mojo/license/model/LicenseStore.java b/src/main/java/org/codehaus/mojo/license/model/LicenseStore.java index 1522529d9..4c67cd4df 100644 --- a/src/main/java/org/codehaus/mojo/license/model/LicenseStore.java +++ b/src/main/java/org/codehaus/mojo/license/model/LicenseStore.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -23,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.model; - import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -48,22 +45,22 @@ public class LicenseStore { /** - * Logger + * Logger. */ private static final Log LOG = LogFactory.getLog( LicenseStore.class ); /** - * class-path directory where is the licenses repository + * class-path directory where is the licenses repository. */ public static final String JAR_LICENSE_REPOSITORY = "/META-INF/licenses"; /** - * list of available license repositories + * list of available license repositories. */ protected List repositories; /** - * flag to know if store was init + * flag to know if store was init. */ protected boolean init; @@ -236,7 +233,6 @@ protected void addRepository( LicenseRepository repository ) } protected void checkInit( String operation ) - throws IllegalStateException { if ( !init ) { @@ -245,7 +241,6 @@ protected void checkInit( String operation ) } protected void checkNotInit( String operation ) - throws IllegalStateException { if ( init ) { diff --git a/src/main/java/org/codehaus/mojo/license/model/ProjectLicenseInfo.java b/src/main/java/org/codehaus/mojo/license/model/ProjectLicenseInfo.java index 6e01d955e..1a829ec52 100644 --- a/src/main/java/org/codehaus/mojo/license/model/ProjectLicenseInfo.java +++ b/src/main/java/org/codehaus/mojo/license/model/ProjectLicenseInfo.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2010 - 2011 Codehaus * %% @@ -22,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.model; import org.apache.maven.artifact.Artifact; import org.apache.maven.model.License; @@ -59,7 +57,7 @@ public void setLicenseResolutionResult( String licenseResolutionResult ) } /** - * Default constructor + * Default constructor. */ public ProjectLicenseInfo() { diff --git a/src/main/java/org/codehaus/mojo/license/utils/FileUtil.java b/src/main/java/org/codehaus/mojo/license/utils/FileUtil.java index 8d16dac78..347058bc3 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/FileUtil.java +++ b/src/main/java/org/codehaus/mojo/license/utils/FileUtil.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin @@ -20,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.utils; - import org.codehaus.plexus.util.FileUtils; import org.codehaus.plexus.util.IOUtil; @@ -204,14 +204,14 @@ public static void backupFile( File f ) /** * Permet de lire un fichier et de retourner sont contenu sous forme d'une - * chaine de carateres + * chaine de carateres. * * @param file le fichier a lire * @param encoding encoding to read file * @return the content of the file * @throws IOException if IO pb */ - static public String readAsString( File file, String encoding ) + public static String readAsString( File file, String encoding ) throws IOException { FileInputStream inf = new FileInputStream( file ); diff --git a/src/main/java/org/codehaus/mojo/license/utils/LicenseDownloader.java b/src/main/java/org/codehaus/mojo/license/utils/LicenseDownloader.java index 4ec97fbfd..4c9762f5a 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/LicenseDownloader.java +++ b/src/main/java/org/codehaus/mojo/license/utils/LicenseDownloader.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.utils; import java.io.File; import java.io.FileOutputStream; diff --git a/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryReader.java b/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryReader.java index b2f3fe4db..eb583e36e 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryReader.java +++ b/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryReader.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.utils; import org.apache.maven.model.License; import org.codehaus.mojo.license.model.ProjectLicenseInfo; diff --git a/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryWriter.java b/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryWriter.java index cc1963b6d..2a9cd99c8 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryWriter.java +++ b/src/main/java/org/codehaus/mojo/license/utils/LicenseSummaryWriter.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.utils; import org.apache.maven.model.License; import org.codehaus.mojo.license.model.ProjectLicenseInfo; diff --git a/src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java b/src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java index 704fd99c1..62acb0cf6 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java +++ b/src/main/java/org/codehaus/mojo/license/utils/MojoHelper.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin @@ -19,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.utils; import org.apache.maven.artifact.Artifact; import org.apache.maven.model.Resource; @@ -29,6 +30,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.text.MessageFormat; +import java.util.Arrays; import java.util.Comparator; import java.util.List; @@ -120,16 +122,16 @@ public int compare( MavenProject o1, MavenProject o2 ) } - static final protected double[] timeFactors = { 1000000, 1000, 60, 60, 24 }; + protected static final double[] TIME_FACTORS = { 1000000, 1000, 60, 60, 24 }; - static final protected String[] timeUnites = { "ns", "ms", "s", "m", "h", "d" }; + protected static final String[] TIME_UNITES = { "ns", "ms", "s", "m", "h", "d" }; - static public String convertTime( long value ) + public static String convertTime( long value ) { - return convert( value, timeFactors, timeUnites ); + return convert( value, TIME_FACTORS, TIME_UNITES ); } - static public String convert( long value, double[] factors, String[] unites ) + public static String convert( long value, double[] factors, String[] unites ) { long sign = value == 0 ? 1 : value / Math.abs( value ); int i = 0; @@ -151,10 +153,8 @@ static public String convert( long value, double[] factors, String[] unites ) * @param baseUrl base url to use * @param suffix suffix to add * @return the new url - * @throws IllegalArgumentException if malformed url. */ public static URL getUrl( URL baseUrl, String suffix ) - throws IllegalArgumentException { String url = baseUrl.toString() + "/" + suffix; try @@ -204,4 +204,10 @@ public static String getArtifactName( MavenProject project ) return sb.toString(); } + + public static List getParams( String params ) + { + String[] split = params == null ? new String[0] : params.split( "," ); + return Arrays.asList( split ); + } } diff --git a/src/main/java/org/codehaus/mojo/license/utils/SortedProperties.java b/src/main/java/org/codehaus/mojo/license/utils/SortedProperties.java index dc6775a35..775fa1c57 100644 --- a/src/main/java/org/codehaus/mojo/license/utils/SortedProperties.java +++ b/src/main/java/org/codehaus/mojo/license/utils/SortedProperties.java @@ -1,3 +1,5 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * Maven helper plugin @@ -20,9 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.utils; - - import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -159,7 +158,7 @@ public void store( File dst ) * voulue. */ @SuppressWarnings( { "unchecked" } ) - static public List toGenericList( List list, Class type ) + public static List toGenericList( List list, Class type ) throws IllegalArgumentException { if ( list.isEmpty() ) diff --git a/src/main/resources/META-INF/licenses/licenses.properties b/src/main/resources/META-INF/licenses/licenses.properties index 765c1cab8..597634b39 100644 --- a/src/main/resources/META-INF/licenses/licenses.properties +++ b/src/main/resources/META-INF/licenses/licenses.properties @@ -1,9 +1,6 @@ ### # #%L # License Maven Plugin -# -# $Id$ -# $HeadURL$ # %% # Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit # %% diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties index ba473bfc1..114768c08 100644 --- a/src/main/resources/log4j.properties +++ b/src/main/resources/log4j.properties @@ -1,9 +1,6 @@ ### # #%L # License Maven Plugin -# -# $Id$ -# $HeadURL$ # %% # Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit # %% diff --git a/src/main/resources/org/codehaus/mojo/license/default-file-header-description.ftl b/src/main/resources/org/codehaus/mojo/license/default-file-header-description.ftl index 6fa165653..4af2f2d3b 100644 --- a/src/main/resources/org/codehaus/mojo/license/default-file-header-description.ftl +++ b/src/main/resources/org/codehaus/mojo/license/default-file-header-description.ftl @@ -1,3 +1,24 @@ +<#-- + #%L + License Maven Plugin + %% + Copyright (C) 2012 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 + . + #L% + --> <#-- To render the description of a license file header. Available context : - project the maven project diff --git a/src/main/resources/org/codehaus/mojo/license/licenses.xsd b/src/main/resources/org/codehaus/mojo/license/licenses.xsd index a984c20a9..4a4f70cb1 100644 --- a/src/main/resources/org/codehaus/mojo/license/licenses.xsd +++ b/src/main/resources/org/codehaus/mojo/license/licenses.xsd @@ -1,21 +1,25 @@ - + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + . + #L% + --> . + #L% + --> <#-- To render the third-party file. Available context : - dependencyMap a collection of Map.Entry with diff --git a/src/main/resources/org/codehaus/mojo/license/third-party-file.ftl b/src/main/resources/org/codehaus/mojo/license/third-party-file.ftl index 9d27a8b36..5546a4c01 100644 --- a/src/main/resources/org/codehaus/mojo/license/third-party-file.ftl +++ b/src/main/resources/org/codehaus/mojo/license/third-party-file.ftl @@ -1,3 +1,24 @@ +<#-- + #%L + License Maven Plugin + %% + Copyright (C) 2012 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 + . + #L% + --> <#-- To render the third-party file. Available context : @@ -10,27 +31,27 @@ values are all dependencies using this license --> <#function licenseFormat licenses> - <#assign result = ""/> - <#list licenses as license> - <#assign result = result + " (" +license + ")"/> - - <#return result> + <#assign result = ""/> + <#list licenses as license> + <#assign result = result + " (" +license + ")"/> + + <#return result> <#function artifactFormat p> - <#if p.name?index_of('Unnamed') > -1> - <#return p.artifactId + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")"> - <#else> - <#return p.name + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")"> - + <#if p.name?index_of('Unnamed') > -1> + <#return p.artifactId + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")"> + <#else> + <#return p.name + " (" + p.groupId + ":" + p.artifactId + ":" + p.version + " - " + (p.url!"no url defined") + ")"> + <#if dependencyMap?size == 0> The project has no dependencies. <#else> Lists of ${dependencyMap?size} third-party dependencies. - <#list dependencyMap as e> - <#assign project = e.getKey()/> - <#assign licenses = e.getValue()/> - ${licenseFormat(licenses)} ${artifactFormat(project)} - + <#list dependencyMap as e> + <#assign project = e.getKey()/> + <#assign licenses = e.getValue()/> + ${licenseFormat(licenses)} ${artifactFormat(project)} + diff --git a/src/main/resources/third-party-report.properties b/src/main/resources/third-party-report.properties index 53a84c73f..d62027f06 100644 --- a/src/main/resources/third-party-report.properties +++ b/src/main/resources/third-party-report.properties @@ -1,7 +1,6 @@ ### # #%L # License Maven Plugin -# # %% # Copyright (C) 2012 CodeLutin, Codehaus, Tony Chemit # %% diff --git a/src/main/resources/third-party-report_en.properties b/src/main/resources/third-party-report_en.properties index efef9b1cb..bedcf2b68 100644 --- a/src/main/resources/third-party-report_en.properties +++ b/src/main/resources/third-party-report_en.properties @@ -1,7 +1,6 @@ ### # #%L # License Maven Plugin -# # %% # Copyright (C) 2012 CodeLutin, Codehaus, Tony Chemit # %% diff --git a/src/main/resources/third-party-report_fr.properties b/src/main/resources/third-party-report_fr.properties index 6d8c4af85..b0c6c1aeb 100644 --- a/src/main/resources/third-party-report_fr.properties +++ b/src/main/resources/third-party-report_fr.properties @@ -1,7 +1,6 @@ ### # #%L # License Maven Plugin -# # %% # Copyright (C) 2012 CodeLutin, Codehaus, Tony Chemit # %% diff --git a/src/site/apt/examples/example-add-license.apt b/src/site/apt/examples/example-add-license.apt index 352285858..c36d40f83 100644 --- a/src/site/apt/examples/example-add-license.apt +++ b/src/site/apt/examples/example-add-license.apt @@ -1,9 +1,6 @@ ~~~ ~~ #%L ~~ License Maven Plugin -~~ -~~ $Id$ -~~ $HeadURL$ ~~ %% ~~ Copyright (C) 2008 - 2011 CodeLutin, Jean Couteau ~~ %% diff --git a/src/site/apt/examples/example-comment-style-list.apt.vm b/src/site/apt/examples/example-comment-style-list.apt.vm index cac24386f..8b47a63a4 100644 --- a/src/site/apt/examples/example-comment-style-list.apt.vm +++ b/src/site/apt/examples/example-comment-style-list.apt.vm @@ -1,3 +1,25 @@ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + ------ Comment style List Examples ------ diff --git a/src/site/apt/examples/example-download-licenses.apt.vm b/src/site/apt/examples/example-download-licenses.apt.vm index 3936915b6..c3e2be03b 100644 --- a/src/site/apt/examples/example-download-licenses.apt.vm +++ b/src/site/apt/examples/example-download-licenses.apt.vm @@ -1,3 +1,25 @@ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + ------ Download Licenses Examples ------ diff --git a/src/site/apt/examples/example-license-list.apt.vm b/src/site/apt/examples/example-license-list.apt.vm index ce68964c6..eb2af4f76 100644 --- a/src/site/apt/examples/example-license-list.apt.vm +++ b/src/site/apt/examples/example-license-list.apt.vm @@ -1,3 +1,25 @@ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + ------ License List Examples ------ diff --git a/src/site/apt/examples/example-thirdparty.apt.vm b/src/site/apt/examples/example-thirdparty.apt.vm index 6c36e2c0d..708887617 100644 --- a/src/site/apt/examples/example-thirdparty.apt.vm +++ b/src/site/apt/examples/example-thirdparty.apt.vm @@ -1,3 +1,25 @@ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + ------ Thirdparty Licenses Examples ------ diff --git a/src/site/apt/examples/update-file-header-config.apt.vm b/src/site/apt/examples/update-file-header-config.apt.vm index 2a84069a0..9a741367b 100644 --- a/src/site/apt/examples/update-file-header-config.apt.vm +++ b/src/site/apt/examples/update-file-header-config.apt.vm @@ -1,9 +1,6 @@ ~~~ ~~ #%L ~~ License Maven Plugin -~~ -~~ $Id$ -~~ $HeadURL$ ~~ %% ~~ Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit ~~ %% diff --git a/src/site/apt/header.apt b/src/site/apt/header.apt index 801f5cdb7..c4a5a47c6 100644 --- a/src/site/apt/header.apt +++ b/src/site/apt/header.apt @@ -1,9 +1,6 @@ ~~~ ~~ #%L ~~ License Maven Plugin -~~ -~~ $Id$ -~~ $HeadURL$ ~~ %% ~~ Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit ~~ %% diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm index a694276cc..0d24e0545 100644 --- a/src/site/apt/index.apt.vm +++ b/src/site/apt/index.apt.vm @@ -1,4 +1,26 @@ - ------ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + +------ Introduction ------ ------ diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm index 617dd86a2..c02c8e047 100644 --- a/src/site/apt/usage.apt.vm +++ b/src/site/apt/usage.apt.vm @@ -1,3 +1,25 @@ +~~~ +~~ #%L +~~ License Maven Plugin +~~ %% +~~ Copyright (C) 2008 - 2011 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 +~~ . +~~ #L% +~~~ + ------ Usage ------ diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml index 28281f52d..5fda69fbd 100644 --- a/src/site/fml/faq.fml +++ b/src/site/fml/faq.fml @@ -1,23 +1,26 @@ + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + . + #L% + --> diff --git a/src/site/site.xml b/src/site/site.xml index d530fdf79..b5bbb09c6 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,23 +1,26 @@ + You should have received a copy of the GNU General Lesser Public + License along with this program. If not, see + . + #L% + --> diff --git a/src/test/java/org/codehaus/mojo/license/api/FreeMarkerHelperTest.java b/src/test/java/org/codehaus/mojo/license/api/FreeMarkerHelperTest.java index a369185fd..463a1acec 100644 --- a/src/test/java/org/codehaus/mojo/license/api/FreeMarkerHelperTest.java +++ b/src/test/java/org/codehaus/mojo/license/api/FreeMarkerHelperTest.java @@ -1,12 +1,33 @@ package org.codehaus.mojo.license.api; +/* + * #%L + * License Maven Plugin + * %% + * Copyright (C) 2012 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 + * . + * #L% + */ + import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.project.MavenProject; -import org.codehaus.mojo.license.UpdateFileHeaderMojo; import org.codehaus.mojo.license.model.LicenseMap; import org.junit.Test; @@ -121,16 +142,16 @@ public void testRenderTemplateForUpdateFileHeader() Map properties = new HashMap(); properties.put( "project", project ); - properties.put( "projectName", "projectName"); + properties.put( "projectName", "projectName" ); properties.put( "inceptionYear", "inceptionYear" ); - properties.put( "organizationName", "organizationName"); - properties.put( "addSvnKeyWords", true); + properties.put( "organizationName", "organizationName" ); + properties.put( "addSvnKeyWords", true ); String s = helper.renderTemplate( "/org/codehaus/mojo/license/default-file-header-description.ftl", properties ); - Assert.assertEquals("projectName\n" + - "$Id:"+"$\n" + - "$HeadURL:"+"$", s); + Assert.assertEquals( "projectName\n" + + "$Id:" + "$\n" + + "$HeadURL:" + "$", s ); if ( log.isInfoEnabled() ) { log.info( s ); diff --git a/src/test/java/org/codehaus/mojo/license/header/transformer/AbstractFileHeaderTransformerTest.java b/src/test/java/org/codehaus/mojo/license/header/transformer/AbstractFileHeaderTransformerTest.java index 74f1ad001..4c906fb52 100644 --- a/src/test/java/org/codehaus/mojo/license/header/transformer/AbstractFileHeaderTransformerTest.java +++ b/src/test/java/org/codehaus/mojo/license/header/transformer/AbstractFileHeaderTransformerTest.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -23,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.header.transformer; - import org.codehaus.mojo.license.header.FileHeader; import org.junit.After; import org.junit.Assert; @@ -34,11 +31,7 @@ import java.util.regex.Matcher; import static org.codehaus.mojo.license.header.transformer.AbstractFileHeaderTransformer.COPYRIGHT_PATTERN; -import static org.codehaus.mojo.license.header.transformer.FileHeaderTransformer.DEFAULT_PROCESS_END_TAG; -import static org.codehaus.mojo.license.header.transformer.FileHeaderTransformer.DEFAULT_PROCESS_START_TAG; -import static org.codehaus.mojo.license.header.transformer.FileHeaderTransformer.DEFAULT_SECTION_DELIMITER; -import static org.codehaus.mojo.license.header.transformer.FileHeaderTransformer.LINE_SEPARATOR; -import static org.codehaus.mojo.license.header.transformer.JavaFileHeaderTransformer.*; +import static org.codehaus.mojo.license.header.transformer.FileHeaderTransformer.*; /** * Tests the {@link AbstractFileHeaderTransformer}. @@ -259,36 +252,39 @@ public void testBoxComment() header = transformer.toString( model1 ); boxedHeader = transformer.boxComment( header, true ); - Assert.assertEquals( COMMENT_START_TAG + LINE_SEPARATOR + COMMENT_LINE_PREFIX + "Description" + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + "Copyright (C) 2010 Tony" + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + "License" + LINE_SEPARATOR + COMMENT_END_TAG + LINE_SEPARATOR, + String commentLinePrefix = " * "; + String commentStartTag = "/*"; + String commentEndTag = " */"; + Assert.assertEquals( commentStartTag + LINE_SEPARATOR + commentLinePrefix + "Description" + LINE_SEPARATOR + + commentLinePrefix + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + + commentLinePrefix + "Copyright (C) 2010 Tony" + LINE_SEPARATOR + + commentLinePrefix + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + + commentLinePrefix + "License" + LINE_SEPARATOR + commentEndTag + LINE_SEPARATOR, boxedHeader ); boxedHeader = transformer.boxComment( header, false ); Assert.assertEquals( - COMMENT_LINE_PREFIX + "Description" + LINE_SEPARATOR + COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + - LINE_SEPARATOR + COMMENT_LINE_PREFIX + "Copyright (C) 2010 Tony" + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + COMMENT_LINE_PREFIX + "License" + + commentLinePrefix + "Description" + LINE_SEPARATOR + commentLinePrefix + DEFAULT_SECTION_DELIMITER + + LINE_SEPARATOR + commentLinePrefix + "Copyright (C) 2010 Tony" + LINE_SEPARATOR + + commentLinePrefix + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + commentLinePrefix + "License" + LINE_SEPARATOR, boxedHeader ); header = transformer.toString( model2 ); boxedHeader = transformer.boxComment( header, true ); - Assert.assertEquals( - COMMENT_START_TAG + LINE_SEPARATOR + COMMENT_LINE_PREFIX + "Description2" + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + COMMENT_LINE_PREFIX + - "Copyright (C) 2010 - 2012 Tony2" + LINE_SEPARATOR + COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + - LINE_SEPARATOR + COMMENT_LINE_PREFIX + "License2" + LINE_SEPARATOR + COMMENT_END_TAG + LINE_SEPARATOR, - boxedHeader ); + Assert.assertEquals( commentStartTag + LINE_SEPARATOR + commentLinePrefix + "Description2" + LINE_SEPARATOR + + commentLinePrefix + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + commentLinePrefix + + "Copyright (C) 2010 - 2012 Tony2" + LINE_SEPARATOR + commentLinePrefix + + DEFAULT_SECTION_DELIMITER + + LINE_SEPARATOR + commentLinePrefix + "License2" + LINE_SEPARATOR + commentEndTag + + LINE_SEPARATOR, boxedHeader ); boxedHeader = transformer.boxComment( header, false ); Assert.assertEquals( - COMMENT_LINE_PREFIX + "Description2" + LINE_SEPARATOR + COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + - LINE_SEPARATOR + COMMENT_LINE_PREFIX + "Copyright (C) 2010 - 2012 Tony2" + LINE_SEPARATOR + - COMMENT_LINE_PREFIX + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + COMMENT_LINE_PREFIX + "License2" + + commentLinePrefix + "Description2" + LINE_SEPARATOR + commentLinePrefix + DEFAULT_SECTION_DELIMITER + + LINE_SEPARATOR + commentLinePrefix + "Copyright (C) 2010 - 2012 Tony2" + LINE_SEPARATOR + + commentLinePrefix + DEFAULT_SECTION_DELIMITER + LINE_SEPARATOR + commentLinePrefix + "License2" + LINE_SEPARATOR, boxedHeader ); } diff --git a/src/test/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformerTest.java b/src/test/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformerTest.java index 172e414f9..ed91aefcb 100644 --- a/src/test/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformerTest.java +++ b/src/test/java/org/codehaus/mojo/license/header/transformer/XmlFileHeaderTransformerTest.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.header.transformer; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -22,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.header.transformer; import org.junit.After; import org.junit.Assert; diff --git a/src/test/java/org/codehaus/mojo/license/model/LicenseRepositoryTest.java b/src/test/java/org/codehaus/mojo/license/model/LicenseRepositoryTest.java index 2a3370b9d..bd6ad4940 100644 --- a/src/test/java/org/codehaus/mojo/license/model/LicenseRepositoryTest.java +++ b/src/test/java/org/codehaus/mojo/license/model/LicenseRepositoryTest.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -23,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.model; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/codehaus/mojo/license/model/LicenseStoreTest.java b/src/test/java/org/codehaus/mojo/license/model/LicenseStoreTest.java index 4f0b68006..1b17a3ccd 100644 --- a/src/test/java/org/codehaus/mojo/license/model/LicenseStoreTest.java +++ b/src/test/java/org/codehaus/mojo/license/model/LicenseStoreTest.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.model; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -23,8 +22,6 @@ * #L% */ -package org.codehaus.mojo.license.model; - import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/codehaus/mojo/license/utils/LicenseSummaryTest.java b/src/test/java/org/codehaus/mojo/license/utils/LicenseSummaryTest.java index d28dbb463..1da49b3ed 100644 --- a/src/test/java/org/codehaus/mojo/license/utils/LicenseSummaryTest.java +++ b/src/test/java/org/codehaus/mojo/license/utils/LicenseSummaryTest.java @@ -1,9 +1,8 @@ +package org.codehaus.mojo.license.utils; + /* * #%L * License Maven Plugin - * - * $Id$ - * $HeadURL$ * %% * Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit * %% @@ -22,7 +21,6 @@ * . * #L% */ -package org.codehaus.mojo.license.utils; import org.apache.maven.model.License; import org.codehaus.mojo.license.model.ProjectLicenseInfo; diff --git a/src/test/resources/license-summary-test.xml b/src/test/resources/license-summary-test.xml index 670d345fc..7c695d24d 100644 --- a/src/test/resources/license-summary-test.xml +++ b/src/test/resources/license-summary-test.xml @@ -2,9 +2,6 @@ - diff --git a/src/test/resources/log4j.properties b/src/test/resources/log4j.properties index 69453a0e6..dd3210e03 100644 --- a/src/test/resources/log4j.properties +++ b/src/test/resources/log4j.properties @@ -1,9 +1,6 @@ ### # #%L # License Maven Plugin -# -# $Id$ -# $HeadURL$ # %% # Copyright (C) 2008 - 2011 CodeLutin, Codehaus, Tony Chemit # %% From a5c2c2a9bac305a1acd64422ec2991254e815419 Mon Sep 17 00:00:00 2001 From: Tony Chemit Date: Thu, 17 May 2012 22:58:19 +0000 Subject: [PATCH 3/3] [maven-release-plugin] prepare release license-maven-plugin-1.1 git-svn-id: file:///home/tiste/MOJOHAUS-TO-GIT/SVN-MOJO-WIP/trunk/mojo/license-maven-plugin@16641 52ab4f32-60fc-0310-b215-8acea882cd1b --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f1bb67f7b..9a8b70cf8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,13 +33,13 @@ license-maven-plugin maven-plugin License Maven Plugin - 1.1-SNAPSHOT + 1.1 Maven plugin to download and collect license files from project dependencies. - scm:svn:http://svn.codehaus.org/mojo/trunk/mojo/license-maven-plugin - scm:svn:https://svn.codehaus.org/mojo/trunk/mojo/license-maven-plugin - http://fisheye.codehaus.org/browse/mojo/trunk/mojo/license-maven-plugin + scm:svn:http://svn.codehaus.org/mojo/tags/license-maven-plugin-1.1 + scm:svn:https://svn.codehaus.org/mojo/tags/license-maven-plugin-1.1 + http://fisheye.codehaus.org/browse/mojo/tags/license-maven-plugin-1.1