Maven-license-plugin-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- 268 discussions
Author: tchemit
Date: 2010-04-16 19:33:28 +0200 (Fri, 16 Apr 2010)
New Revision: 1761
Log:
update headers
Modified:
trunk/src/site/site_fr.xml
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2010-04-16 17:30:17 UTC (rev 1760)
+++ trunk/src/site/site_fr.xml 2010-04-16 17:33:28 UTC (rev 1761)
@@ -2,23 +2,22 @@
<!--
#%L
Maven License Plugin
-
$Id: site_en.xml 1751 2010-04-15 13:57:24Z tchemit $
$HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/site_en.xml $
%%
Copyright (C) 2008 - 2010 CodeLutin
%%
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
+ 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
+
+ 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%
1
0
Author: tchemit
Date: 2010-04-16 19:30:17 +0200 (Fri, 16 Apr 2010)
New Revision: 1760
Log:
optimize pom + add Jean as member
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-04-16 17:17:45 UTC (rev 1759)
+++ trunk/pom.xml 2010-04-16 17:30:17 UTC (rev 1760)
@@ -151,26 +151,6 @@
<scope>provided</scope>
</dependency>
- <!--dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-velocity</artifactId>
- <version>1.1.7</version>
- <exclusions>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-container-default</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-component-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- </exclusion>
- </exclusions>
- </dependency-->
-
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -294,9 +274,7 @@
<name>Maven License Plugin</name>
<description>
- Plugin pour mettre à jour l'en-tête des fichiers (avec la license
- choisie)
- dans un module maven 2.
+ Plugin de gestion des licenses (et en-têtes) dans un project maven 2.
</description>
<inceptionYear>2008</inceptionYear>
<url>http://maven-site.nuiton.org/maven-license-plugin</url>
@@ -313,6 +291,16 @@
<role>Développeur</role>
</roles>
</developer>
+ <developer>
+ <name>Jean Couteau</name>
+ <id>jcouteau</id>
+ <email>couteau(a)codelutin.com</email>
+ <organization>CodeLutin</organization>
+ <timezone>+2</timezone>
+ <roles>
+ <role>Développeur</role>
+ </roles>
+ </developer>
</developers>
<!-- ************************************************************* -->
@@ -321,13 +309,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk
- </connection>
- <developerConnection>
- scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk
- </developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk
- </url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
</scm>
<!-- ************************************************************* -->
1
0
r1759 - in trunk: . src/main/java/org/nuiton/license/plugin src/site src/site/fr/apt src/site/resources
by tchemit@users.nuiton.org 16 Apr '10
by tchemit@users.nuiton.org 16 Apr '10
16 Apr '10
Author: tchemit
Date: 2010-04-16 19:17:45 +0200 (Fri, 16 Apr 2010)
New Revision: 1759
Log:
- finalize documentation
- improve xsd generation (keep it in src/site/resources)
- improve final log of update-file-header
Added:
trunk/src/site/resources/
trunk/src/site/resources/licenseProjectDescriptor-1.0.0.xsd
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java
trunk/src/site/fr/apt/descriptor.apt
trunk/src/site/fr/apt/index.apt
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-04-16 16:32:53 UTC (rev 1758)
+++ trunk/pom.xml 2010-04-16 17:17:45 UTC (rev 1759)
@@ -321,9 +321,13 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk
+ </connection>
+ <developerConnection>
+ scm:svn:http://svn.nuiton.org/svn/maven-license-plugin/trunk
+ </developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/maven-license-plugin/trunk
+ </url>
</scm>
<!-- ************************************************************* -->
@@ -334,14 +338,16 @@
<properties>
- <siteSourcesType>apt</siteSourcesType>
-
+ <!-- processor version -->
<processor.version>1.0.2</processor.version>
- <!-- version of project license descriptor model -->
+ <!-- license project descriptor model version -->
<mdoVersion>1.0.0</mdoVersion>
- <!-- documentation is in english -->
+ <!-- documentation is in apt format -->
+ <siteSourcesType>apt</siteSourcesType>
+
+ <!-- documentation is in english then french -->
<siteLocales>en,fr</siteLocales>
</properties>
@@ -359,6 +365,9 @@
<version>${mdoVersion}</version>
<lineLength>80</lineLength>
<useJava5>true</useJava5>
+ <models>
+ <model>src/main/mdo/descriptor.mdo</model>
+ </models>
</configuration>
<executions>
<execution>
@@ -366,9 +375,7 @@
<phase>generate-sources</phase>
<goals>
<goal>xpp3-reader</goal>
- <goal>xpp3-writer</goal>
<goal>java</goal>
- <goal>xsd</goal>
</goals>
<configuration>
<models>
@@ -377,16 +384,13 @@
</configuration>
</execution>
<execution>
- <id>mdo-site</id>
- <phase>pre-site</phase>
+ <id>mdo-xsd</id>
+ <phase>generate-resources</phase>
<goals>
- <goal>xdoc</goal>
<goal>xsd</goal>
</goals>
<configuration>
- <models>
- <model>src/main/mdo/descriptor.mdo</model>
- </models>
+ <outputDirectory>src/site/resources</outputDirectory>
</configuration>
</execution>
</executions>
@@ -460,7 +464,7 @@
</activation>
<build>
-
+
<plugins>
<plugin>
@@ -474,28 +478,8 @@
</executions>
</plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <!-- TC-20100117 : 1.3 does not works here -->
- <version>1.2</version>
- <executions>
- <!-- copy generated xsd to site -->
- <execution>
- <id>copy-descriptor-xsd</id>
- <phase>pre-site</phase>
- <configuration>
- <tasks>
- <copy verbose="${maven.verbose}" failonerror="false" overwrite="false" file="target/generated-site/xsd/licenseProjectDescriptor-${mdoVersion}.xsd" tofile="target/site/licenseProjectDescriptor-${mdoVersion}.xsd"/>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
-
+
</build>
</profile>
Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-04-16 16:32:53 UTC (rev 1758)
+++ trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-04-16 17:17:45 UTC (rev 1759)
@@ -245,7 +245,7 @@
if (isUpdateCopyright()) {
- getLog().warn("updateCopyright is not still available...");
+ getLog().warn("\n\nupdateCopyright is not still available...\n\n");
//TODO-TC20100409 checks scm
// checks scm is ok
// for the moment, will only deal with svn except if scm
@@ -267,6 +267,8 @@
@Override
public void doAction() throws Exception {
+ long t0 = System.nanoTime();
+
clear();
processedFiles = new HashSet<File>();
@@ -281,18 +283,34 @@
} finally {
- StringBuilder buffer = new StringBuilder();
+ int nbFiles = getProcessedFiles().size();
+ if (nbFiles == 0) {
+ getLog().warn("No file to scan.");
+ } else {
+ String delay = PluginHelper.convertTime(System.nanoTime() - t0);
+ String message = String.format(
+ "Scan %s file%s header done in %s.",
+ nbFiles,
+ nbFiles > 1 ? "s" : "",
+ delay
+ );
+ getLog().info(message);
+ }
+ Set<FileState> states = result.keySet();
+ if (states.size() == 1 && states.contains(FileState.uptodate)) {
+ // all files where up to date
+ getLog().info("All files are up-to-date.");
+ } else {
- String format = "Operation result on %1$s file(s) :";
- buffer.append(String.format(format, getProcessedFiles().size()));
+ StringBuilder buffer = new StringBuilder();
+ for (FileState state : FileState.values()) {
- for (FileState state : FileState.values()) {
+ reportType(state, buffer);
+ }
- reportType(state, buffer);
+ getLog().info(buffer.toString());
}
- getLog().info(buffer.toString());
-
// clean internal states
if (isClearAfterOperation()) {
clear();
Modified: trunk/src/site/fr/apt/descriptor.apt
===================================================================
--- trunk/src/site/fr/apt/descriptor.apt 2010-04-16 16:32:53 UTC (rev 1758)
+++ trunk/src/site/fr/apt/descriptor.apt 2010-04-16 17:17:45 UTC (rev 1759)
@@ -40,7 +40,7 @@
xsd
- Ce fichier est géré par un {{{./licenseProjectDescriptor-1.0.0.xsd}fichier xsd}}.
+ Ce fichier est géré par un {{{../licenseProjectDescriptor-1.0.0.xsd}fichier xsd}}.
Exemple
Modified: trunk/src/site/fr/apt/index.apt
===================================================================
--- trunk/src/site/fr/apt/index.apt 2010-04-16 16:32:53 UTC (rev 1758)
+++ trunk/src/site/fr/apt/index.apt 2010-04-16 17:17:45 UTC (rev 1759)
@@ -86,15 +86,20 @@
Le plugin a les goals suivants :
- * {{{./update-project-license-mojo.html}update-project-license}} ajoute ou met à jour les fichiers de license du projet (depuis 2.1).
+ * {{{./update-project-license-mojo.html}update-project-license}} ajoute ou
+ met à jour les fichiers de license du projet (depuis 2.1).
- * {{{./update-file-header-mojo.html}update-file-header}} ajoute ou met à jour les headers de license des fichiers (depuis 2.1).
+ * {{{./update-file-header-mojo.html}update-file-header}} ajoute ou met à jour
+ les headers de license des fichiers (depuis 2.1).
- * {{{./add-third-party-mojo.html}add-third-party}} crée le fichier THIRD-PARTY.txt dans le build.
+ * {{{./add-third-party-mojo.html}add-third-party}} crée le fichier
+ <THIRD-PARTY.txt> dans le build.
- * {{{./comment-style-list-mojo.html}comment-style-list}} Affiche la liste des styles de commentaire disponibles (depuis 2.1).
+ * {{{./license-list-mojo.html}license-list}} Affiche la liste des licenses
+ disponibles.
- * {{{./license-list-mojo.html}license-list}} Affiche la liste des licenses disponibles.
+ * {{{./comment-style-list-mojo.html}comment-style-list}} Affiche la liste des
+ styles de commentaire disponibles (depuis 2.1).
* {{{./help-mojo.html}help}} Affiche l'aide du plugin (goals, usage).
Added: trunk/src/site/resources/licenseProjectDescriptor-1.0.0.xsd
===================================================================
--- trunk/src/site/resources/licenseProjectDescriptor-1.0.0.xsd (rev 0)
+++ trunk/src/site/resources/licenseProjectDescriptor-1.0.0.xsd 2010-04-16 17:17:45 UTC (rev 1759)
@@ -0,0 +1,254 @@
+<?xml version="1.0"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" targetNamespace="http://maven-site.nuiton.org/maven-license-plugin/1.0.0">
+ <xs:element name="project" type="LicenseProjectDescriptor">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ The license project descriptor describe licenses used in a project.
+ <p/>
+ <ul>
+ <li>mainLicense of the project</li>
+ <li>headers to update (or add) on sources of the project</li>
+ </ul>
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:complexType name="LicenseProjectDescriptor">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ The license project descriptor describe licenses used in a project.
+ <p/>
+ <ul>
+ <li>mainLicense of the project</li>
+ <li>headers to update (or add) on sources of the project</li>
+ </ul>
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="mainLicense" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ The main license of the project (or module). The LICENSE.txt will
+ contains the content of this license.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="headers">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Collection of header.
+
+ {@link Header}
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="header" minOccurs="0" maxOccurs="unbounded" type="Header"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="header" type="Header">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ To add a single header.
+
+ {@link Header}
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="Header">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ A Header represents a set of resources using the same {@code header type}.
+ <p/>
+ The licenseName can be inherited by the mainLicense of the project.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="licenseName" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ The license to apply in this set. If not fill, will use
+ the main license.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="commentStyle" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ The style of the comment which box the header to generate (or updates).
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="fileSets">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies file sets to include in the license set. A fileSet is
+ specified by providing one or more of &lt;licenseSet&gt; subelements.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="fileSet" minOccurs="0" maxOccurs="unbounded" type="FileSet"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="fileSet" type="FileSet">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Specifies a single file sets to include in the license set. A fileSet is
+ specified by providing one or more of &lt;licenseSet&gt; subelements.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+ <xs:complexType name="FileSet">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ A fileSet allows the inclusion of groups of files into the license set
+ and defines also the type of header to generate.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:all>
+ <xs:element minOccurs="0" name="useDefaultExcludes" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Whether standard exclusion patterns, such as those matching CVS and
+ Subversion
+ metadata files, should be used when calculating the files affected
+ by this set.
+ For backward compatibility, the default value is true. (Since 2.2)
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="basedir" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+ Sets the basedir directory relative to the root
+ of the root directory of the assembly. For example,
+ "log" will put the specified files in the log directory.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="includes">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ When &lt;include&gt; subelements are present, they define a set of
+ files and directory to include. If none is present, then
+ &lt;includes&gt; represents all valid values.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="include" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="include" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ <p>
+ To add a single include.
+ </p>
+ When &lt;include&gt; subelements are present, they define a set of
+ files and directory to include. If none is present, then
+ &lt;includes&gt; represents all valid values.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="excludes">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ When &lt;exclude&gt; subelements are present, they define a set of
+ files and directory to exclude. If none is present, then
+ &lt;excludes&gt; represents no exclusions.
+
+ </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="exclude" minOccurs="0" maxOccurs="unbounded" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" name="exclude" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ <p>
+ To add a single exclude.
+ </p>
+ When &lt;exclude&gt; subelements are present, they define a set of
+ files and directory to exclude. If none is present, then
+ &lt;excludes&gt; represents no exclusions.
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" name="lineEnding" type="xs:string">
+ <xs:annotation>
+ <xs:documentation source="version">1.0.0+</xs:documentation>
+ <xs:documentation source="description">
+
+ Sets the line-endings of the files in this fileSet.
+ Valid values:
+ <ul>
+ <li><b>"keep"</b> - Preserve all line endings</li>
+ <li><b>"unix"</b> - Use Unix-style line endings</li>
+ <li><b>"lf"</b> - Use a single line-feed line endings</li>
+ <li><b>"dos"</b> - Use DOS-style line endings</li>
+ <li><b>"crlf"</b> - Use Carraige-return, line-feed line endings</li>
+ </ul>
+
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:all>
+ </xs:complexType>
+</xs:schema>
\ No newline at end of file
Property changes on: trunk/src/site/resources/licenseProjectDescriptor-1.0.0.xsd
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
1
0
Author: jcouteau
Date: 2010-04-16 18:32:53 +0200 (Fri, 16 Apr 2010)
New Revision: 1758
Log:
Add two missing spaces
Modified:
trunk/src/site/apt/header.apt
trunk/src/site/fr/apt/index.apt
Modified: trunk/src/site/apt/header.apt
===================================================================
--- trunk/src/site/apt/header.apt 2010-04-16 15:47:18 UTC (rev 1757)
+++ trunk/src/site/apt/header.apt 2010-04-16 16:32:53 UTC (rev 1758)
@@ -94,7 +94,7 @@
Here is the available comment styles.
- Using the goal{{{./comment-style-list-mojo.html}comment-style-list}}
+ Using the goal {{{./comment-style-list-mojo.html}comment-style-list}}
you can find all of them.
* java style
@@ -151,4 +151,4 @@
%%License-Ignore
--------------------------------------------------------------------------------
- You can change it with <<ignoreTag>> property.
\ No newline at end of file
+ You can change it with <<ignoreTag>> property.
Modified: trunk/src/site/fr/apt/index.apt
===================================================================
--- trunk/src/site/fr/apt/index.apt 2010-04-16 15:47:18 UTC (rev 1757)
+++ trunk/src/site/fr/apt/index.apt 2010-04-16 16:32:53 UTC (rev 1758)
@@ -94,7 +94,7 @@
* {{{./comment-style-list-mojo.html}comment-style-list}} Affiche la liste des styles de commentaire disponibles (depuis 2.1).
- * {{{./license-list-mojo.html}license-list}}Affiche la liste des licenses disponibles.
+ * {{{./license-list-mojo.html}license-list}} Affiche la liste des licenses disponibles.
* {{{./help-mojo.html}help}} Affiche l'aide du plugin (goals, usage).
1
0
Author: tchemit
Date: 2010-04-16 17:47:18 +0200 (Fri, 16 Apr 2010)
New Revision: 1757
Log:
finalize documentation english + french
Modified:
trunk/pom.xml
trunk/src/site/fr/apt/descriptor.apt
trunk/src/site/fr/apt/header.apt
trunk/src/site/fr/apt/index.apt
trunk/src/site/site_en.xml
trunk/src/site/site_fr.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/pom.xml 2010-04-16 15:47:18 UTC (rev 1757)
@@ -23,7 +23,9 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
-->
-<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/maven-v4_0_0.xsd">
+<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -340,7 +342,7 @@
<mdoVersion>1.0.0</mdoVersion>
<!-- documentation is in english -->
- <siteLocales>en</siteLocales>
+ <siteLocales>en,fr</siteLocales>
</properties>
@@ -405,29 +407,6 @@
</plugins>
- <!--pluginManagement>
- <plugins>
-
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <dependencies>
- <dependency>
- <groupId>org.nuiton.jrst</groupId>
- <artifactId>doxia-module-jrst</artifactId>
- <version>${jrst.version}</version>
- <exclusions>
- <exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- </plugin>
-
- </plugins>
- </pluginManagement-->
-
</build>
<profiles>
Modified: trunk/src/site/fr/apt/descriptor.apt
===================================================================
--- trunk/src/site/fr/apt/descriptor.apt 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/src/site/fr/apt/descriptor.apt 2010-04-16 15:47:18 UTC (rev 1757)
@@ -40,12 +40,12 @@
xsd
- Ce fichier est géré par un {{{./licenseProjectDescriptor-1.0.0.xsd}fichier xsd}}_.
+ Ce fichier est géré par un {{{./licenseProjectDescriptor-1.0.0.xsd}fichier xsd}}.
Exemple
L'exemple suivant applique la license lgpl v3 à tous les fichier java présents
- dans **src/main/java**.
+ dans <<src/main/java>>.
-------------------------------------------------------------------------------
@@ -73,7 +73,7 @@
Comment créer son propre fichier project.xml
- Le fichier project.xml doit être situé dans le dossier **src/license**.
+ Le fichier <<project.xml>> doit être situé dans le dossier <<src/license>>.
Le fichier xml est inclus entre des balises project. Vous décrivez ensuite la
license principale du projet en utilisant les codes du plugin (utilisez
@@ -85,8 +85,8 @@
principale du projet est utilisée. Vous pouvez déclarer le répertoire de base
et le pattern de sélection/inclusion de fichiers.
- Nottez que vous n'êtes pas limités dans le nombre de headers. Vous pouvez
+ Notez que vous n'êtes pas limités dans le nombre de headers. Vous pouvez
créer un header pour un fichier dans le cas de code copié depuis un autre
- projet par exemple, ou vous pouvez utiliser le tag %%IgnoreLicense dans le
- fichier lui-même. L'exemple précédent devrait vous permettre de créer votre
+ projet par exemple, ou vous pouvez utiliser le tag <<% %Ignore-License>> dans
+ le fichier lui-même. L'exemple précédent devrait vous permettre de créer votre
propre fichier project.xml.
Modified: trunk/src/site/fr/apt/header.apt
===================================================================
--- trunk/src/site/fr/apt/header.apt 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/src/site/fr/apt/header.apt 2010-04-16 15:47:18 UTC (rev 1757)
@@ -51,11 +51,17 @@
--------------------------------------------------------------------------------
* (1) Le tag de début de process, utilisé pour détecter le début du header (ne JAMAIS l'enlever).
+
* (2) Section de description du projet
+
* (3) Délimiteur de section
+
* (4) Section copyright (plus d'information ci-dessous)
+
* (5) Délimiteur de section
+
* (6) Section license
+
* (7) Le tag de fin de process, utilisé pour détecter la fin du header (ne JAMAIS l'enlever).
* Configuration
@@ -63,7 +69,9 @@
Vous pouvez configurer :
* le tag de début de process
+
* le délimiteur de section
+
* le tag de fin de process
* Modèle de copyright
@@ -75,7 +83,7 @@
Copyright (C) firstYear[ - lastYear] holder
--------------------------------------------------------------------------------
- Si *firstYear* et *lastYear* sont les même, lastYear peut être omis.
+ Si <<firstYear>> et <<lastYear>> sont les même, lastYear peut être omis.
* Bloc commentaire
@@ -134,7 +142,8 @@
Ignorer un header
- Si ne voulez pas que le goal `update-file-header` traite un fichier en
+ Si ne voulez pas que le goal
+ {{{./update-file-header-mojo.html}update-file-header}} traite un fichier en
particulier, vous pouvez utiliser un tag spécifique dans votre classe :
--------------------------------------------------------------------------------
@@ -142,4 +151,4 @@
%%License-Ignore
--------------------------------------------------------------------------------
- Vous pouvez le changer avec la propriété **ignoreTag**.
+ Vous pouvez le changer avec la propriété <<ignoreTag>>.
Modified: trunk/src/site/fr/apt/index.apt
===================================================================
--- trunk/src/site/fr/apt/index.apt 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/src/site/fr/apt/index.apt 2010-04-16 15:47:18 UTC (rev 1757)
@@ -52,6 +52,7 @@
* la première partie donne des informations générales du module maven telles
que nom du projet, organisation, ...
+
* la séconde partie résume la license elle-même.
Voici un example :
Modified: trunk/src/site/site_en.xml
===================================================================
--- trunk/src/site/site_en.xml 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/src/site/site_en.xml 2010-04-16 15:47:18 UTC (rev 1757)
@@ -48,6 +48,12 @@
<item name="${project.name}" href="index.html"/>
</breadcrumbs>
+ <links>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ <item name="[fr" href="./fr/index.html" />
+ <item name="en]" href="index.html" />
+ </links>
+
<menu name="User">
<item name="Introduction" href="index.html"/>
<item name="File header model" href="header.html"/>
Modified: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml 2010-04-16 14:06:40 UTC (rev 1756)
+++ trunk/src/site/site_fr.xml 2010-04-16 15:47:18 UTC (rev 1757)
@@ -48,6 +48,12 @@
<item name="${project.name}" href="index.html"/>
</breadcrumbs>
+ <links>
+ <item name="Libre-Entreprise" href="http://www.libre-entreprise.org/"/>
+ <item name="[fr" href="index.html" />
+ <item name="en]" href="../index.html" />
+ </links>
+
<menu name="Utilisateur">
<item name="Introduction" href="index.html"/>
<item name="Modèle de header de fichier" href="header.html"/>
1
0
Author: jcouteau
Date: 2010-04-16 16:06:40 +0200 (Fri, 16 Apr 2010)
New Revision: 1756
Log:
Add some doc, add site french translation
Added:
trunk/src/site/fr/
trunk/src/site/fr/apt/
trunk/src/site/fr/apt/descriptor.apt
trunk/src/site/fr/apt/header.apt
trunk/src/site/fr/apt/index.apt
trunk/src/site/fr/apt/usage.apt
trunk/src/site/site_fr.xml
Modified:
trunk/src/site/apt/descriptor.apt
trunk/src/site/apt/index.apt
trunk/src/site/site_en.xml
Modified: trunk/src/site/apt/descriptor.apt
===================================================================
--- trunk/src/site/apt/descriptor.apt 2010-04-16 11:56:15 UTC (rev 1755)
+++ trunk/src/site/apt/descriptor.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -39,15 +39,13 @@
{{{./update-file-header-mojo.html}update-file-header}} and
{{{./update-project-license-mojo.html}update-project-license}}.
- TODO-TC-20100409 Do this documentation
-
xsd
This file is ruled by a {{{./licenseProjectDescriptor-1.0.0.xsd}xsd file}}.
Example
- The next example applies a gpl v3 license on all java files in **src/main/java**.
+ The next example applies a lgpl v3 license on all java files in **src/main/java**.
-------------------------------------------------------------------------------
@@ -71,4 +69,22 @@
</header>
</headers>
</project>
--------------------------------------------------------------------------------
\ No newline at end of file
+-------------------------------------------------------------------------------
+
+How to create your own project.xml file
+
+ The project.xml file should be located in the src/license directory.
+
+ The xml file is included in project tags. Then you describe the main license
+ using one of the codes present in maven-license-plugin (use
+ mvn license:license-list -Ddetail to get the list of the codes and
+ corresponding licenses).
+
+ You can then declare headers. A header is the association of a license and a
+ comment-style. If no license is present, the mainLicense will be taken. You
+ can set here the base dir and the files to include and/or exclude pattern.
+
+ Note that your are not limited in the number of headers. You can create a
+ header for one file in case of copied code from other projects, but in this
+ case you might prefer using the %%IgnoreLicense tag in the file itself. The
+ previous example should help you create your project.xml file.
Modified: trunk/src/site/apt/index.apt
===================================================================
--- trunk/src/site/apt/index.apt 2010-04-16 11:56:15 UTC (rev 1755)
+++ trunk/src/site/apt/index.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -47,11 +47,11 @@
The header is composed of two parts :
- * the first part gives some common informations for all files of a maven
+ * the first part gives some common information for all files of a maven
module (such as project name, organisation, ...).
* the second part resumes the license used.
- Here a example :
+ Here an example :
-------------------------------------------------------------------------------
@@ -96,9 +96,11 @@
* Usage
- Instructions on how to use the Plugin can be found on {{{./usage.html}usage}} page
+ Instructions on how to use the Plugin can be found on {{{./usage.html}usage}}
+ page
* Examples
- to be done.
+ You can find examples on how to configure and use maven-license-plugin on the
+ {{{./descriptor.html}descriptor}} page
Added: trunk/src/site/fr/apt/descriptor.apt
===================================================================
--- trunk/src/site/fr/apt/descriptor.apt (rev 0)
+++ trunk/src/site/fr/apt/descriptor.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -0,0 +1,92 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id: descriptor.apt 1754 2010-04-16 10:47:43Z tchemit $
+~~ $HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/apt/descripto… $
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+License project descriptor
+----
+
+Abstract
+
+ Ce document décrit le fichier de description de license introduit dans la
+ version 2.1.
+
+ Le but du fichier de description de license est d'énumérer tous les fichiers à
+ inclure dans le process de license par license et par type.
+
+ Ce nouveau format est utilisé dans les goals
+ {{{./update-file-header-mojo.html}update-file-header}} et
+ {{{./update-project-license-mojo.html}update-project-license}}.
+
+xsd
+
+ Ce fichier est géré par un {{{./licenseProjectDescriptor-1.0.0.xsd}fichier xsd}}_.
+
+Exemple
+
+ L'exemple suivant applique la license lgpl v3 à tous les fichier java présents
+ dans **src/main/java**.
+
+-------------------------------------------------------------------------------
+
+ <?xml version='1.0' encoding='UTF-8'?>
+ <project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-…">
+ <mainLicense>gpl_v3</mainLicense>
+ <headers>
+ <header>
+ <licenseName>lgpl_v3</licenseName>
+ <commentStyle>java</commentStyle>
+ <fileSets>
+ <fileSet>
+ <basedir>all/src</basedir>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </header>
+ </headers>
+ </project>
+-------------------------------------------------------------------------------
+
+Comment créer son propre fichier project.xml
+
+ Le fichier project.xml doit être situé dans le dossier **src/license**.
+
+ Le fichier xml est inclus entre des balises project. Vous décrivez ensuite la
+ license principale du projet en utilisant les codes du plugin (utilisez
+ mvn license:license-list -Ddetail pour connaitre la liste des codes et des
+ licenses correspondantes).
+
+ Vous pouvez ensuite déclarer des headers. Un header est l'association d'une
+ license et d'un stye de commentaire. S'il n'y a pas de license, la license
+ principale du projet est utilisée. Vous pouvez déclarer le répertoire de base
+ et le pattern de sélection/inclusion de fichiers.
+
+ Nottez que vous n'êtes pas limités dans le nombre de headers. Vous pouvez
+ créer un header pour un fichier dans le cas de code copié depuis un autre
+ projet par exemple, ou vous pouvez utiliser le tag %%IgnoreLicense dans le
+ fichier lui-même. L'exemple précédent devrait vous permettre de créer votre
+ propre fichier project.xml.
Added: trunk/src/site/fr/apt/header.apt
===================================================================
--- trunk/src/site/fr/apt/header.apt (rev 0)
+++ trunk/src/site/fr/apt/header.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -0,0 +1,145 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id: header.apt 1754 2010-04-16 10:47:43Z tchemit $
+~~ $HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/apt/header.apt $
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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 Header
+----
+
+Abstract
+
+ Ce document décrit le modèle d'header de fichier introduit dans la version 2.1.
+
+ Vous allez apprendre à l'adapter et l'utiliser avec le goal
+ {{{./update-file-header-mojo.html}update-file-header}}.
+
+Modèle de header
+
+* Exemple
+
+ Voici un example de header de fichier (SANS inclusion dans un bloc commentaire) :
+
+--------------------------------------------------------------------------------
+
+ (1) # % L
+ (2) Description du projet
+ (3) %%
+ (4) Copyright (C) 2010 votre organization
+ (5) %%
+ (6) Contenu de la license
+ (7) # L %
+--------------------------------------------------------------------------------
+
+ * (1) Le tag de début de process, utilisé pour détecter le début du header (ne JAMAIS l'enlever).
+ * (2) Section de description du projet
+ * (3) Délimiteur de section
+ * (4) Section copyright (plus d'information ci-dessous)
+ * (5) Délimiteur de section
+ * (6) Section license
+ * (7) Le tag de fin de process, utilisé pour détecter la fin du header (ne JAMAIS l'enlever).
+
+* Configuration
+
+ Vous pouvez configurer :
+
+ * le tag de début de process
+ * le délimiteur de section
+ * le tag de fin de process
+
+* Modèle de copyright
+
+ La section de copyright doit être exactement de la forme :
+
+--------------------------------------------------------------------------------
+
+ Copyright (C) firstYear[ - lastYear] holder
+--------------------------------------------------------------------------------
+
+ Si *firstYear* et *lastYear* sont les même, lastYear peut être omis.
+
+* Bloc commentaire
+
+ Dans un fichier, nous devons obligatoirement placé le header de fichier dans
+ un commentaire. Dans le fichier de description, vous pouvez l'adapter en
+ choisissant un headerType.
+
+Styles de commeantaire disponible
+
+ Voici la liste des styles de commentaire disponible. Vous pouvez les lister
+ en utilisant le goal {{{./comment-style-list-mojo.html}comment-style-list}}.
+
+* java style
+
+--------------------------------------------------------------------------------
+
+ /*
+ * HEADER
+ */
+--------------------------------------------------------------------------------
+
+* xml style
+
+--------------------------------------------------------------------------------
+
+ <!--
+ HEADER
+ -->
+--------------------------------------------------------------------------------
+
+* properties style
+
+--------------------------------------------------------------------------------
+
+ ######
+ # HEADER
+ ######
+--------------------------------------------------------------------------------
+
+* apt style
+
+--------------------------------------------------------------------------------
+
+ ~~~~~~
+ ~~ HEADER
+ ~~~~~~
+--------------------------------------------------------------------------------
+
+* rst style
+
+--------------------------------------------------------------------------------
+ .. -
+ .. * HEADER
+ .. -
+--------------------------------------------------------------------------------
+
+Ignorer un header
+
+ Si ne voulez pas que le goal `update-file-header` traite un fichier en
+ particulier, vous pouvez utiliser un tag spécifique dans votre classe :
+
+--------------------------------------------------------------------------------
+
+ %%License-Ignore
+--------------------------------------------------------------------------------
+
+ Vous pouvez le changer avec la propriété **ignoreTag**.
Added: trunk/src/site/fr/apt/index.apt
===================================================================
--- trunk/src/site/fr/apt/index.apt (rev 0)
+++ trunk/src/site/fr/apt/index.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -0,0 +1,108 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id: index.apt 1754 2010-04-16 10:47:43Z tchemit $
+~~ $HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/apt/index.apt $
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+Introduction
+----
+
+Maven license Plugin
+
+ Le Maven License Plugin est utilisé pour gérer les license dans un projet
+ Maven.
+
+* NOTE
+ Dans la documentation, les tags de process sont séparés par des espaces où le
+ plugin ne pourrait PAS gérer la license de ces fichiers !
+
+
+Header de license
+
+ Le header de license est un commentaire ajouté en haut des fichiers source.
+
+ Pour détecter le header dans les fichiers, nous utilisons la technologie
+ processor, avec les tags
+
+-------------------------------------------------------------------------------
+
+ # % L Contenu # L %
+-------------------------------------------------------------------------------
+
+ Les header est composé de deux parties :
+
+ * la première partie donne des informations générales du module maven telles
+ que nom du projet, organisation, ...
+ * la séconde partie résume la license elle-même.
+
+ Voici un example :
+
+-------------------------------------------------------------------------------
+
+ /*
+ * # % L
+ * Plugin maven de changement de license
+ * %%
+ * Copyright (C) 2008 - 2009 CodeLutin
+ * %%
+ * 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 %
+ */
+-------------------------------------------------------------------------------
+
+* Aperçu des goals
+
+ Le plugin a les goals suivants :
+
+ * {{{./update-project-license-mojo.html}update-project-license}} ajoute ou met à jour les fichiers de license du projet (depuis 2.1).
+
+ * {{{./update-file-header-mojo.html}update-file-header}} ajoute ou met à jour les headers de license des fichiers (depuis 2.1).
+
+ * {{{./add-third-party-mojo.html}add-third-party}} crée le fichier THIRD-PARTY.txt dans le build.
+
+ * {{{./comment-style-list-mojo.html}comment-style-list}} Affiche la liste des styles de commentaire disponibles (depuis 2.1).
+
+ * {{{./license-list-mojo.html}license-list}}Affiche la liste des licenses disponibles.
+
+ * {{{./help-mojo.html}help}} Affiche l'aide du plugin (goals, usage).
+
+* Utilisation
+
+ Les instructions sur l'utilsiation du plugin peuvent être trouvées sur la
+ page d'{{{./usage.html}utilisation}}
+
+* Examples
+
+ Vous pouez trouvez des examples sur comment configurer et utiliser
+ maven-license-plugin sur la page du {{{./descriptor.html}descripteur}}.
Added: trunk/src/site/fr/apt/usage.apt
===================================================================
--- trunk/src/site/fr/apt/usage.apt (rev 0)
+++ trunk/src/site/fr/apt/usage.apt 2010-04-16 14:06:40 UTC (rev 1756)
@@ -0,0 +1,151 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id: usage.apt 1754 2010-04-16 10:47:43Z tchemit $
+~~ $HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/apt/usage.apt $
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+Usage
+----
+
+Actions
+
+* update-project-license goal
+
+ Ce goal crée ou met à jour le fichier LICENSE.txt et l'ajoute au build.
+
+ Il peut aussi générer un fichier bundle License pour éviter la collision de
+ noms dans une application finale
+
+ pour plus d'informations, référez-vous à la
+ {{{./update-project-license-mojo.html}page de détail}}.
+
+* update-file-header goal
+
+ Ce goal ajoute ou met à jour les header de licenses des fichiers en utilisant
+ un fichier de description xml permettant de décrire les fichiers d'un module à
+ inclure dans le process de license.
+
+ Pour plus d'informations, référez-vous à
+ {{{./update-file-header-mojo.html}la page de détail}}.
+
+* add-third-party goal
+
+ Ce goal construit le fichier THIRD-PARTY.txt et l'ajoute au build.
+
+ Pour plus de détails, référez-vous à
+ {{{./add-third-party-mojo.html}la page de détail}}.
+
+Obtenir des informations
+
+* license-list goal
+
+ Ce goal affiche les licenses disponibles.
+
+ A utiliser directement (et seulement) depuis la ligne de commande :
+
+-------------------------------------------------------------------------------
+
+ mvn license:license-list
+-------------------------------------------------------------------------------
+
+ Pour afficher le header de license, utilisez le paramètre <<detail>> :
+
+-------------------------------------------------------------------------------
+ mvn license:license-list -Ddetail
+-------------------------------------------------------------------------------
+
+ Pour plus d'informations, référez-vous à
+ {{{./license-list-mojo.html}la page de détail}}.
+
+** Exemple d'exécution
+
+-------------------------------------------------------------------------------
+ [INFO] [license:license-list {execution: default-cli}]
+ [INFO] Available licenses :
+
+ * agpl_v3 : GNU Affero General Public License (AGPL) version 3.0
+ * apache_v2 : Apache License version 2.0
+ * cddl_v1 : COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ * fdl_v1_3 : GNU Free Documentation License (FDL) version 1.3
+ * gpl_v1 : GNU General Public License (GPL) version 1.0
+ * gpl_v2 : GNU General Public License (GPL) version 2.0
+ * gpl_v3 : GNU General Public License (GPL) version 3.0
+ * lgpl_v2_1 : GNU General Lesser Public License (LGPL) version 2.1
+ * lgpl_v3 : GNU General Lesser Public License (LGPL) version 3.0
+ * mit : MIT-License
+-------------------------------------------------------------------------------
+
+* comment-style-list goal
+
+ Ce goal affiche les styles de commentaires disponibles pour boxer le header de
+ fichier.
+
+ A utiliser directement (et simplement) depuis la ligne de commande :
+
+-------------------------------------------------------------------------------
+
+ mvn license:comment-style-list
+-------------------------------------------------------------------------------
+
+ Pour afficher l'exemple, utilisez le paramètre <<detail>> :
+
+-------------------------------------------------------------------------------
+
+ mvn license:comment-style-list -Ddetail
+-------------------------------------------------------------------------------
+
+ Pour plus d'informations, référez-vous à
+ {{{./comment-style-list-mojo.html}la page de détail}}.
+
+** Exemple d'exécution
+
+-------------------------------------------------------------------------------
+ [INFO] [license:comment-style-list {execution: default-cli}]
+ [INFO] List of available comment styles:
+
+ - apt : header transformer with apt comment style
+ - java : header transformer with java comment style
+ - properties : header transformer with properties file comment style
+ - rst : header transformer with rst comment style
+ - xml : header transformer with xml comment style
+-------------------------------------------------------------------------------
+
+* help goal
+
+ Ce goal affiche l'aide du plugin (goals disponibles).
+
+ A utiliser directement (et uniquement) depuis la ligne de commande.
+
+-------------------------------------------------------------------------------
+
+ mvn license:help
+-------------------------------------------------------------------------------
+
+ Pour afficher l'aide verbeuse :
+
+-------------------------------------------------------------------------------
+
+ mvn license:help -Ddetail
+-------------------------------------------------------------------------------
+
+ Pour plus d'informations, référez-vous à
+ {{{./help-mojo.html}la page de détail}}.
Modified: trunk/src/site/site_en.xml
===================================================================
--- trunk/src/site/site_en.xml 2010-04-16 11:56:15 UTC (rev 1755)
+++ trunk/src/site/site_en.xml 2010-04-16 14:06:40 UTC (rev 1756)
@@ -58,7 +58,7 @@
<item name="update-file-header" href="update-file-header-mojo.html"/>
<item name="add-third-party" href="add-third-party-mojo.html"/>
</item>
- <item name="Get informations" href="usage.html#get-informations">
+ <item name="Get information" href="usage.html#get-information">
<item name="license-list" href="license-list-mojo.html"/>
<item name="comment-style-list" href="comment-style-list-mojo.html"/>
<item name="help" href="help-mojo.html"/>
@@ -69,7 +69,7 @@
<menu name="Downloads">
<item
href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}.jar"
- name="Librairie (jar)"/>
+ name="Library (jar)"/>
<item
href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-javadoc.jar"
name="Javadoc (jar)"/>
Added: trunk/src/site/site_fr.xml
===================================================================
--- trunk/src/site/site_fr.xml (rev 0)
+++ trunk/src/site/site_fr.xml 2010-04-16 14:06:40 UTC (rev 1756)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ #%L
+ Maven License Plugin
+
+ $Id: site_en.xml 1751 2010-04-15 13:57:24Z tchemit $
+ $HeadURL: http://svn.nuiton.org/svn/maven-license-plugin/trunk/src/site/site_en.xml $
+ %%
+ Copyright (C) 2008 - 2010 CodeLutin
+ %%
+ 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%
+ -->
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org"
+ name="Maven"
+ img="images/logos/maven-feather.png"/>
+ <logo href="http://maven-nuiton.org/jrst"
+ name="JRst"
+ img="images/jrst-logo.png"/>
+ <logo href="http://docutils.sourceforge.net/rst.html"
+ name="ReStructuredText"
+ img="images/restructuredtext-logo.png"/>
+ </poweredBy>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="Modèle de header de fichier" href="header.html"/>
+ <item name="Descripteur de license du projet" href="descriptor.html"/>
+ <item name="Usage" href="usage.html">
+ <item name="Actions" href="usage.html#actions">
+ <item name="update-project-license" href="update-project-license-mojo.html"/>
+ <item name="update-file-header" href="update-file-header-mojo.html"/>
+ <item name="add-third-party" href="add-third-party-mojo.html"/>
+ </item>
+ <item name="Obtenir des informations" href="usage.html#obtenir-des-informations">
+ <item name="license-list" href="license-list-mojo.html"/>
+ <item name="comment-style-list" href="comment-style-list-mojo.html"/>
+ <item name="help" href="help-mojo.html"/>
+ </item>
+ </item>
+ </menu>
+
+ <menu name="Téléchargements">
+ <item
+ href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item
+ href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item
+ href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
1
0
r1755 - in trunk/src: it it/add-third-party it/add-third-party/no-deps it/add-third-party/with-deps main/java/org/nuiton/license/plugin site/apt
by tchemit@users.nuiton.org 16 Apr '10
by tchemit@users.nuiton.org 16 Apr '10
16 Apr '10
Author: tchemit
Date: 2010-04-16 13:56:15 +0200 (Fri, 16 Apr 2010)
New Revision: 1755
Log:
- Evolution #532: Uniformize add-third-party mojo to update-project-license
- Evolution #533: Use apt documentation rather than rst one to avoid cyclic dependencies
Added:
trunk/src/it/add-third-party/
trunk/src/it/add-third-party/no-deps/
trunk/src/it/add-third-party/no-deps/invoker.properties
trunk/src/it/add-third-party/no-deps/pom.xml
trunk/src/it/add-third-party/no-deps/verify.groovy
trunk/src/it/add-third-party/with-deps/
trunk/src/it/add-third-party/with-deps/invoker.properties
trunk/src/it/add-third-party/with-deps/pom.xml
trunk/src/it/add-third-party/with-deps/verify.groovy
trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java
Removed:
trunk/src/it/add-third-party-file/
Modified:
trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java
trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java
trunk/src/site/apt/descriptor.apt
trunk/src/site/apt/header.apt
Added: trunk/src/it/add-third-party/no-deps/invoker.properties
===================================================================
--- trunk/src/it/add-third-party/no-deps/invoker.properties (rev 0)
+++ trunk/src/it/add-third-party/no-deps/invoker.properties 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,21 @@
+# A comma or space separated list of goals/phases to execute, may
+# specify an empty list to execute the default goal of the IT project
+invoker.goals=clean compile
+
+# Optionally, a list of goals to run during further invocations of Maven
+#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
+
+# A comma or space separated list of profiles to activate
+#invoker.profiles=run-all run-once
+
+# The value for the environment variable MAVEN_OPTS
+#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
+
+# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
+invoker.failureBehavior=fail-at-end
+
+# The expected result of the build, possible values are "success" (default) and "failure"
+#invoker.buildResult=success
+
+# A boolean value controlling the -N flag, defaults to "false"
+#invoker.nonRecursive=false
Property changes on: trunk/src/it/add-third-party/no-deps/invoker.properties
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/add-third-party/no-deps/pom.xml
===================================================================
--- trunk/src/it/add-third-party/no-deps/pom.xml (rev 0)
+++ trunk/src/it/add-third-party/no-deps/pom.xml 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.license.test</groupId>
+ <artifactId>test-add-third-party</artifactId>
+ <version>@pom.version@</version>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>License Test :: add-third-party</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <license.generateBundle>true</license.generateBundle>
+ <license.verbose>true</license.verbose>
+ </properties>
+ <build>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-license-plugin</artifactId>
+ <version>@pom.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>add-third-party</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
+
Property changes on: trunk/src/it/add-third-party/no-deps/pom.xml
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/add-third-party/no-deps/verify.groovy
===================================================================
--- trunk/src/it/add-third-party/no-deps/verify.groovy (rev 0)
+++ trunk/src/it/add-third-party/no-deps/verify.groovy 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,24 @@
+
+file = new File(basedir, 'target/generated-sources/license/THIRD-PARTY.txt');
+assert file.exists();
+content = file.text;
+assert content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/generated-sources/license/META-INF/test-add-third-party-THIRD-PARTY.txt');
+assert file.exists();
+content = file.text;
+assert content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/classes/THIRD-PARTY.txt');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/classes/META-INF/test-add-third-party-THIRD-PARTY.txt');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'the project has no dependencies.' );
+
+return true;
Property changes on: trunk/src/it/add-third-party/no-deps/verify.groovy
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/add-third-party/with-deps/invoker.properties
===================================================================
--- trunk/src/it/add-third-party/with-deps/invoker.properties (rev 0)
+++ trunk/src/it/add-third-party/with-deps/invoker.properties 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,21 @@
+# A comma or space separated list of goals/phases to execute, may
+# specify an empty list to execute the default goal of the IT project
+invoker.goals=clean compile
+
+# Optionally, a list of goals to run during further invocations of Maven
+#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run
+
+# A comma or space separated list of profiles to activate
+#invoker.profiles=run-all run-once
+
+# The value for the environment variable MAVEN_OPTS
+#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
+
+# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
+invoker.failureBehavior=fail-at-end
+
+# The expected result of the build, possible values are "success" (default) and "failure"
+#invoker.buildResult=success
+
+# A boolean value controlling the -N flag, defaults to "false"
+#invoker.nonRecursive=false
Property changes on: trunk/src/it/add-third-party/with-deps/invoker.properties
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/add-third-party/with-deps/pom.xml
===================================================================
--- trunk/src/it/add-third-party/with-deps/pom.xml (rev 0)
+++ trunk/src/it/add-third-party/with-deps/pom.xml 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- ************************************************************* -->
+ <!-- *** POM Relationships *************************************** -->
+ <!-- ************************************************************* -->
+
+ <groupId>org.nuiton.license.test</groupId>
+ <artifactId>test-add-third-party</artifactId>
+ <version>@pom.version@</version>
+
+ <!-- ************************************************************* -->
+ <!-- *** Project Information ************************************* -->
+ <!-- ************************************************************* -->
+
+ <name>License Test :: add-third-party</name>
+
+ <!-- ************************************************************* -->
+ <!-- *** Build Settings ****************************************** -->
+ <!-- ************************************************************* -->
+
+ <packaging>jar</packaging>
+
+ <properties>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <license.thirdPartyFilename>third.txt</license.thirdPartyFilename>
+ <license.bundleThirdPartyPath>test/third.txt</license.bundleThirdPartyPath>
+ <license.generateBundle>true</license.generateBundle>
+ <license.verbose>true</license.verbose>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ </dependencies>
+ <build>
+
+ <plugins>
+
+ <plugin>
+ <groupId>org.nuiton</groupId>
+ <artifactId>maven-license-plugin</artifactId>
+ <version>@pom.version@</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>add-third-party</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
+
Property changes on: trunk/src/it/add-third-party/with-deps/pom.xml
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/add-third-party/with-deps/verify.groovy
===================================================================
--- trunk/src/it/add-third-party/with-deps/verify.groovy (rev 0)
+++ trunk/src/it/add-third-party/with-deps/verify.groovy 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,22 @@
+
+file = new File(basedir, 'target/generated-sources/license/third.txt');
+assert file.exists();
+content = file.text;
+assert !content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/generated-sources/license/test/third.txt');
+assert file.exists();
+content = file.text;
+assert !content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/classes/third.txt');
+assert file.exists();
+content = file.text;
+assert !content.contains( 'the project has no dependencies.' );
+
+file = new File(basedir, 'target/classes/test/third.txt');
+assert file.exists();
+content = file.text;
+assert !content.contains( 'the project has no dependencies.' );
+
+return true;
Property changes on: trunk/src/it/add-third-party/with-deps/verify.groovy
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-16 10:47:43 UTC (rev 1754)
+++ trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-16 11:56:15 UTC (rev 1755)
@@ -25,394 +25,11 @@
package org.nuiton.license.plugin;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
-import org.apache.maven.model.License;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectBuilder;
-import org.apache.maven.project.ProjectBuildingException;
-import org.apache.maven.shared.dependency.tree.DependencyNode;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
-import org.nuiton.plugin.PluginHelper;
-
-import java.io.File;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
/**
- * Le goal pour copier le fichier THIRD-PARTY.txt (contenant les licenses de
- * toutes les dependances du projet) dans le classpath (et le generer s'il
- * n'existe pas).
- *
* @author tchemit <chemit(a)codelutin.com>
- * @goal add-third-party
- * @phase generate-resources
- * @requiresDependencyResolution test
- * @requiresProject true
+ * @deprecated since 2.2, use instead the {@link AddThirdPartyMojo} class.
*/
-public class AddThirdPartyFileMojo extends AbstractLicenseMojo {
+@Deprecated
+public class AddThirdPartyFileMojo extends AddThirdPartyMojo {
- private static final String unknownLicenseMessage = "Unknown license";
-
- /**
- * Fichier ou ecrire les licences des dependances.
- *
- * @parameter expression="${license.thirdPartyFilename}"
- * default-value="THIRD-PARTY.txt"
- * @required
- * @since 1.0.0
- */
- protected String thirdPartyFilename;
-
- /**
- * Repertoire de sortie des classes (classpath).
- *
- * @parameter expression="${license.outputDirectory}" default-value="target/generated-sources/license"
- * @required
- * @since 1.0.0
- */
- protected File outputDirectory;
-
- /**
- * Un flag pour forcer la generation.
- *
- * @parameter expression="${license.force}" default-value="false"
- * @since 1.0.0
- */
- protected boolean force;
-
- /**
- * Un flag pour conserver un backup des fichiers modifies.
- *
- * @parameter expression="${license.keepBackup}" default-value="false"
- * @since 1.0.0
- */
- protected boolean keepBackup;
-
- /**
- * Un flag pour faire une copie nommé dans META-INF (prefixe avec le nom de
- * l'artifact).
- *
- * @parameter expression="${license.generateBundle}" default-value="false"
- * @since 1.0.0
- * @deprecated since 2.2 (use instead {@code generateBundle}
- */
- @Deprecated
- protected boolean copyToMETA_INF;
-
- /**
- * Un flag pour faire une copie nommé dans META-INF (prefixe avec le nom de
- * l'artifact).
- *
- * @parameter expression="${license.generateBundle}" default-value="false"
- * @since 1.0.0
- */
- protected boolean generateBundle;
-
- /**
- * Local Repository.
- *
- * @parameter expression="${localRepository}"
- * @required
- * @readonly
- * @since 1.0.0
- */
- protected ArtifactRepository localRepository;
-
- /**
- * Remote repositories used for the project.
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @required
- * @readonly
- * @since 1.0.0
- */
- protected List<?> remoteRepositories;
-
- /**
- * Dependency tree builder component.
- *
- * @component
- */
- protected DependencyTreeBuilder dependencyTreeBuilder;
-
- /**
- * Artifact Factory component.
- *
- * @component
- */
- protected ArtifactFactory factory;
-
- /**
- * Artifact metadata source component.
- *
- * @component
- */
- protected ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * Artifact collector component.
- *
- * @component
- */
- protected ArtifactCollector collector;
-
- /**
- * Maven Project Builder component.
- *
- * @component
- */
- protected MavenProjectBuilder mavenProjectBuilder;
-
- /**
- * content of third party file (only computed if {@link #force} is active or
- * the {@link #thirdPartyFile} does not exist, or is not up-to-date.
- */
- protected String thirdPartyFileContent;
-
- protected File thirdPartyFile;
-
- @Override
- protected boolean checkPackaging() {
- return rejectPackaging(Packaging.pom);
- }
-
- boolean doGenerate;
-
- @Override
- protected void init() throws Exception {
- if (getLog().isDebugEnabled()) {
-
- // always be verbose in debug mode
- setVerbose(true);
- }
-
- if (copyToMETA_INF) {
- generateBundle = true;
- }
-
- doGenerate = true;
- thirdPartyFile = new File(outputDirectory, thirdPartyFilename);
-
- if (!force) {
- // regenerate only if file exists and is newer than pom file
- doGenerate = !isFileNewerThanPomFile(thirdPartyFile);
- }
-
- if (doGenerate) {
-
- // prepare thirdPartyFileContent
-
- DependencyNode dependencyTreeNode = resolveProject();
-
- LicenseMap licenseMap = new LicenseMap();
-
- for (Object o : dependencyTreeNode.getChildren()) {
-
- buildLicenseMap((DependencyNode) o, licenseMap);
- }
-
- thirdPartyFileContent = buildGroupedLicenses(licenseMap);
-
- // log dependencies with no license
- SortedSet<String> dependenciesWithNoLicense =
- licenseMap.get(unknownLicenseMessage);
- if (dependenciesWithNoLicense != null) {
- for (String dep : dependenciesWithNoLicense) {
- // no license found for the dependency
- getLog().warn("no license found for dependency " + dep);
- }
- }
- } else {
- thirdPartyFileContent = PluginHelper.readAsString(thirdPartyFile, getEncoding());
- }
- }
-
- @Override
- protected void doAction() throws Exception {
- if (doGenerate) {
- if (isVerbose()) {
- getLog().info("writing third-party file : " + thirdPartyFile);
- }
- if (keepBackup && thirdPartyFile.exists()) {
- if (isVerbose()) {
- getLog().info("backup " + thirdPartyFile);
- }
- backupFile(thirdPartyFile);
- }
- writeFile(thirdPartyFile, thirdPartyFileContent, getEncoding());
- }
- if (generateBundle) {
- copyFile(thirdPartyFile, new File(
- outputDirectory,
- "META-INF" + File.separator + getProject().getArtifactId() +
- "-" + thirdPartyFile.getName())
- );
- }
- addResourceDir(outputDirectory, "**/*.txt");
- }
-
- /** @return resolve the dependency tree */
- protected DependencyNode resolveProject() {
- try {
- ArtifactFilter artifactFilter =
- new ScopeArtifactFilter(Artifact.SCOPE_TEST);
- return dependencyTreeBuilder.buildDependencyTree(
- getProject(),
- localRepository,
- factory,
- artifactMetadataSource,
- artifactFilter,
- collector
- );
- } catch (DependencyTreeBuilderException e) {
- getLog().error("Unable to build dependency tree.", e);
- return null;
- }
- }
-
- protected void buildLicenseMap(DependencyNode node, LicenseMap licenseMap) {
- if (node.getState() != DependencyNode.INCLUDED) {
- // this dependency is not included, so do not treate it
- if (isVerbose()) {
- getLog().info("do not include this dependency " +
- node.toNodeString());
- }
- return;
- }
- Artifact artifact = node.getArtifact();
-
- if (isVerbose() && getLog().isDebugEnabled()) {
- getLog().debug("treate node " + node.toNodeString());
- }
-
- if (!Artifact.SCOPE_SYSTEM.equals(artifact.getScope())) {
- try {
- MavenProject artifactProject =
- getMavenProjectFromRepository(artifact);
- String artifactName = getArtifactName(artifactProject);
-
- List<?> licenses = artifactProject.getLicenses();
-
- if (licenses.isEmpty()) {
- // no license found for the dependency
- licenseMap.put(unknownLicenseMessage, artifactName);
-
- } else {
- for (Object o : licenses) {
- if (o == null) {
- getLog().warn("could not acquire the license for "
- + artifactName);
- continue;
- }
- License license = (License) o;
- String licenseKey = license.getName();
- if (license.getName() == null) {
- licenseKey = license.getUrl();
- }
- licenseMap.put(licenseKey, artifactName);
- }
- }
- } catch (ProjectBuildingException e) {
- getLog().error("ProjectBuildingException error : ", e);
- }
- }
- if (!node.getChildren().isEmpty()) {
- for (Object o : node.getChildren()) {
- buildLicenseMap((DependencyNode) o, licenseMap);
- }
- }
- }
-
- protected String buildGroupedLicenses(LicenseMap licenseMap) {
- StringBuilder sb = new StringBuilder();
- sb.append("List of third-party dependencies grouped by " +
- "their license type.");
- for (String licenseName : licenseMap.keySet()) {
- sb.append("\n\n").append(licenseName).append(" : ");
-
- SortedSet<String> projects = licenseMap.get(licenseName);
-
- for (String projectName : projects) {
- sb.append("\n * ").append(projectName);
- }
- }
- return sb.toString();
- }
-
- protected String getArtifactName(MavenProject artifactProject) {
- StringBuilder sb = new StringBuilder();
-
- sb.append(artifactProject.getName());
- sb.append(" (");
- sb.append(artifactProject.getGroupId());
- sb.append(":");
- sb.append(artifactProject.getArtifactId());
- sb.append(":");
- sb.append(artifactProject.getVersion());
- sb.append(" - ");
- String url = artifactProject.getUrl();
- sb.append(url == null ? "no url defined" : url);
- sb.append(")");
-
- return sb.toString();
- }
-
- /**
- * Get the <code>Maven project</code> from the repository depending the
- * <code>Artifact</code> given.
- *
- * @param artifact an artifact
- * @return the Maven project for the given artifact
- * @throws ProjectBuildingException if any
- */
- protected MavenProject getMavenProjectFromRepository(Artifact artifact)
- throws ProjectBuildingException {
-
- boolean allowStubModel = false;
-
- if (!"pom".equals(artifact.getType())) {
- artifact = factory.createProjectArtifact(
- artifact.getGroupId(),
- artifact.getArtifactId(),
- artifact.getVersion(),
- artifact.getScope()
- );
- allowStubModel = true;
- }
-
- // TODO: we should use the MavenMetadataSource instead
- return mavenProjectBuilder.buildFromRepository(
- artifact,
- remoteRepositories,
- localRepository,
- allowStubModel
- );
- }
-
- protected class LicenseMap extends TreeMap<String, SortedSet<String>> {
-
- private static final long serialVersionUID = 864199843545688069L;
-
- public SortedSet<String> put(String key, String value) {
- // handle multiple values as a set to avoid duplicates
- SortedSet<String> valueList = get(key);
- if (valueList == null) {
- valueList = new TreeSet<String>();
- }
- if (getLog().isDebugEnabled()) {
- getLog().debug("key:" + key + ",value: " + value);
- }
- valueList.add(value);
- return put(key, valueList);
- }
- }
}
Added: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java (rev 0)
+++ trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java 2010-04-16 11:56:15 UTC (rev 1755)
@@ -0,0 +1,515 @@
+/*
+ * #%L
+ * Maven License Plugin
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2008 - 2010 CodeLutin
+ * %%
+ * 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%
+ */
+
+package org.nuiton.license.plugin;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.model.License;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.shared.dependency.tree.DependencyNode;
+import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
+import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
+import org.nuiton.plugin.PluginHelper;
+
+import java.io.File;
+import java.util.*;
+
+/**
+ * Le goal pour copier le fichier THIRD-PARTY.txt (contenant les licenses de
+ * toutes les dependances du projet) dans le classpath (et le generer s'il
+ * n'existe pas).
+ *
+ * @author tchemit <chemit(a)codelutin.com>
+ * @goal add-third-party
+ * @phase generate-resources
+ * @requiresDependencyResolution test
+ * @requiresProject true
+ * @since 2.2 (was previously {@code AddThirdPartyFileMojo}).
+ */
+public class AddThirdPartyMojo extends AbstractLicenseMojo {
+
+ private static final String unknownLicenseMessage = "Unknown license";
+
+ /**
+ * Repertoire de sortie des classes (classpath).
+ *
+ * @parameter expression="${license.outputDirectory}" default-value="target/generated-sources/license"
+ * @required
+ * @since 1.0.0
+ */
+ protected File outputDirectory;
+
+ /**
+ * Fichier ou ecrire les licences des dependances.
+ *
+ * @parameter expression="${license.thirdPartyFilename}"
+ * default-value="THIRD-PARTY.txt"
+ * @required
+ * @since 1.0.0
+ */
+ protected String thirdPartyFilename;
+
+ /**
+ * Un flag pour faire une copie nommé dans META-INF (prefixe avec le nom de
+ * l'artifact).
+ *
+ * @parameter expression="${license.generateBundle}" default-value="false"
+ * @since 1.0.0
+ */
+ protected boolean generateBundle;
+
+ /**
+ * The path of the bundled third party file to produce when
+ * {@link #generateBundle} is on.
+ * <p/>
+ * <b>Note:</b> This option is not available for {@code pom} module types.
+ *
+ * @parameter expression="${license.bundleThirdPartyPath}" default-value="META-INF/${project.artifactId}-THIRD-PARTY.txt"
+ * @since 2.2
+ */
+ protected String bundleThirdPartyPath;
+
+ /**
+ * Un flag pour forcer la generation.
+ *
+ * @parameter expression="${license.force}" default-value="false"
+ * @since 1.0.0
+ */
+ protected boolean force;
+
+ /**
+ * Un flag pour conserver un backup des fichiers modifies.
+ *
+ * @parameter expression="${license.keepBackup}" default-value="false"
+ * @since 1.0.0
+ */
+ protected boolean keepBackup;
+
+ /**
+ * Un flag pour faire une copie nommé dans META-INF (prefixe avec le nom de
+ * l'artifact).
+ *
+ * @parameter expression="${license.generateBundle}" default-value="false"
+ * @since 1.0.0
+ * @deprecated since 2.2 (use instead {@code generateBundle}).
+ */
+ @Deprecated
+ protected boolean copyToMETA_INF;
+
+ /**
+ * Local Repository.
+ *
+ * @parameter expression="${localRepository}"
+ * @required
+ * @readonly
+ * @since 1.0.0
+ */
+ protected ArtifactRepository localRepository;
+
+ /**
+ * Remote repositories used for the project.
+ *
+ * @parameter expression="${project.remoteArtifactRepositories}"
+ * @required
+ * @readonly
+ * @since 1.0.0
+ */
+ protected List<?> remoteRepositories;
+
+ /**
+ * Dependency tree builder component.
+ *
+ * @component
+ */
+ protected DependencyTreeBuilder dependencyTreeBuilder;
+
+ /**
+ * Artifact Factory component.
+ *
+ * @component
+ */
+ protected ArtifactFactory factory;
+
+ /**
+ * Artifact metadata source component.
+ *
+ * @component
+ */
+ protected ArtifactMetadataSource artifactMetadataSource;
+
+ /**
+ * Artifact collector component.
+ *
+ * @component
+ */
+ protected ArtifactCollector collector;
+
+ /**
+ * Maven Project Builder component.
+ *
+ * @component
+ */
+ protected MavenProjectBuilder mavenProjectBuilder;
+
+ /**
+ * content of third party file (only computed if {@link #force} is active or
+ * the {@link #thirdPartyFile} does not exist, or is not up-to-date.
+ */
+ protected String thirdPartyFileContent;
+
+ protected File thirdPartyFile;
+
+ boolean doGenerate;
+
+ public static final String NO_DEPENDENCIES_MESSAGE = "the project has no dependencies.";
+
+ @Override
+ protected boolean checkPackaging() {
+ return rejectPackaging(Packaging.pom);
+ }
+
+ @Override
+ protected void init() throws Exception {
+ if (getLog().isDebugEnabled()) {
+
+ // always be verbose in debug mode
+ setVerbose(true);
+ }
+
+ if (copyToMETA_INF) {
+ getLog().warn("\\n copyToMETA_INF is deprecated, prefer" +
+ " use the generateBundle parameter\n\n");
+ setGenerateBundle(true);
+ }
+
+ File file = new File(getOutputDirectory(), getThirdPartyFilename());
+
+ setThirdPartyFile(file);
+
+ setDoGenerate(isForce() || !file.exists() || !isFileNewerThanPomFile(file));
+
+ String content;
+ if (isDoGenerate()) {
+
+ if (isVerbose()) {
+ getLog().info("will generate third-party content...");
+ }
+
+ // build thirdPartyFileContent
+ content = buildThirdPartyFilecontent();
+
+ } else {
+ // read it from existing third party file
+ content = PluginHelper.readAsString(getThirdPartyFile(), getEncoding());
+ }
+
+ setThirdPartyFileContent(content);
+ }
+
+ @Override
+ protected void doAction() throws Exception {
+
+ File target = getThirdPartyFile();
+ if (isDoGenerate()) {
+ if (isVerbose()) {
+ getLog().info("writing third-party file : " + target);
+ }
+ if (isKeepBackup() && target.exists()) {
+ if (isVerbose()) {
+ getLog().info("backup " + target);
+ }
+ backupFile(target);
+ }
+ writeFile(target, getThirdPartyFileContent(), getEncoding());
+ }
+ File output = getOutputDirectory();
+ if (isGenerateBundle()) {
+
+ // creates the bundled license file
+ File bundleTarget =
+ PluginHelper.getFile(output, getBundleThirdPartyPath());
+ copyFile(target, bundleTarget);
+ }
+ addResourceDir(output, "**/*.txt");
+ }
+
+ protected String buildThirdPartyFilecontent() throws DependencyTreeBuilderException {
+ DependencyNode dependencyTreeNode;
+ ArtifactFilter artifactFilter =
+ new ScopeArtifactFilter(Artifact.SCOPE_TEST);
+ dependencyTreeNode = dependencyTreeBuilder.buildDependencyTree(
+ getProject(),
+ localRepository,
+ factory,
+ artifactMetadataSource,
+ artifactFilter,
+ collector
+ );
+
+ LicenseMap licenseMap = new LicenseMap();
+
+ for (Object o : dependencyTreeNode.getChildren()) {
+
+ buildLicenseMap((DependencyNode) o, licenseMap);
+ }
+
+ // log dependencies with no license
+ Set<String> unsafeDependencies =
+ licenseMap.get(getUnknownLicenseMessage());
+
+ if (unsafeDependencies != null) {
+ for (String dep : unsafeDependencies) {
+ // no license found for the dependency
+ getLog().warn("no license found for dependency " + dep);
+ }
+ }
+ StringBuilder sb = new StringBuilder();
+ if (licenseMap.isEmpty()) {
+ sb.append(NO_DEPENDENCIES_MESSAGE);
+ } else {
+ sb.append("List of third-party dependencies grouped by " +
+ "their license type.");
+ for (String licenseName : licenseMap.keySet()) {
+ sb.append("\n\n").append(licenseName).append(" : ");
+
+ SortedSet<String> projects = licenseMap.get(licenseName);
+
+ for (String projectName : projects) {
+ sb.append("\n * ").append(projectName);
+ }
+ }
+ }
+ String content = sb.toString();
+ if (getLog().isDebugEnabled()) {
+ getLog().debug("third-party file content :\n" + content);
+ }
+ return content;
+ }
+
+ protected void buildLicenseMap(DependencyNode node, LicenseMap licenseMap) {
+ if (node.getState() != DependencyNode.INCLUDED) {
+ // this dependency is not included, so do not treate it
+ if (isVerbose()) {
+ getLog().info("do not include this dependency " +
+ node.toNodeString());
+ }
+ return;
+ }
+ Artifact artifact = node.getArtifact();
+
+ if (isVerbose() && getLog().isDebugEnabled()) {
+ getLog().debug("treate node " + node.toNodeString());
+ }
+
+ if (!Artifact.SCOPE_SYSTEM.equals(artifact.getScope())) {
+ try {
+ MavenProject artifactProject =
+ getMavenProjectFromRepository(artifact);
+ String artifactName = getArtifactName(artifactProject);
+
+ List<?> licenses = artifactProject.getLicenses();
+
+ if (licenses.isEmpty()) {
+ // no license found for the dependency
+ licenseMap.put(getUnknownLicenseMessage(), artifactName);
+
+ } else {
+ for (Object o : licenses) {
+ if (o == null) {
+ getLog().warn("could not acquire the license for "
+ + artifactName);
+ continue;
+ }
+ License license = (License) o;
+ String licenseKey = license.getName();
+ if (license.getName() == null) {
+ licenseKey = license.getUrl();
+ }
+ licenseMap.put(licenseKey, artifactName);
+ }
+ }
+ } catch (ProjectBuildingException e) {
+ getLog().error("ProjectBuildingException error : ", e);
+ }
+ }
+ if (!node.getChildren().isEmpty()) {
+ for (Object o : node.getChildren()) {
+ buildLicenseMap((DependencyNode) o, licenseMap);
+ }
+ }
+ }
+
+ protected String getArtifactName(MavenProject artifactProject) {
+ StringBuilder sb = new StringBuilder();
+
+ sb.append(artifactProject.getName());
+ sb.append(" (");
+ sb.append(artifactProject.getGroupId());
+ sb.append(":");
+ sb.append(artifactProject.getArtifactId());
+ sb.append(":");
+ sb.append(artifactProject.getVersion());
+ sb.append(" - ");
+ String url = artifactProject.getUrl();
+ sb.append(url == null ? "no url defined" : url);
+ sb.append(")");
+
+ return sb.toString();
+ }
+
+ /**
+ * Get the <code>Maven project</code> from the repository depending the
+ * <code>Artifact</code> given.
+ *
+ * @param artifact an artifact
+ * @return the Maven project for the given artifact
+ * @throws ProjectBuildingException if any
+ */
+ protected MavenProject getMavenProjectFromRepository(Artifact artifact)
+ throws ProjectBuildingException {
+
+ boolean allowStubModel = false;
+
+ if (!"pom".equals(artifact.getType())) {
+ artifact = factory.createProjectArtifact(
+ artifact.getGroupId(),
+ artifact.getArtifactId(),
+ artifact.getVersion(),
+ artifact.getScope()
+ );
+ allowStubModel = true;
+ }
+
+ // TODO: we should use the MavenMetadataSource instead
+ return mavenProjectBuilder.buildFromRepository(
+ artifact,
+ remoteRepositories,
+ localRepository,
+ allowStubModel
+ );
+ }
+
+ public static String getUnknownLicenseMessage() {
+ return unknownLicenseMessage;
+ }
+
+ public String getThirdPartyFilename() {
+ return thirdPartyFilename;
+ }
+
+ public File getOutputDirectory() {
+ return outputDirectory;
+ }
+
+ public boolean isForce() {
+ return force;
+ }
+
+ public boolean isKeepBackup() {
+ return keepBackup;
+ }
+
+ public boolean isGenerateBundle() {
+ return generateBundle;
+ }
+
+ public boolean isDoGenerate() {
+ return doGenerate;
+ }
+
+ public String getBundleThirdPartyPath() {
+ return bundleThirdPartyPath;
+ }
+
+ public File getThirdPartyFile() {
+ return thirdPartyFile;
+ }
+
+ public String getThirdPartyFileContent() {
+ return thirdPartyFileContent;
+ }
+
+ public void setThirdPartyFilename(String thirdPartyFilename) {
+ this.thirdPartyFilename = thirdPartyFilename;
+ }
+
+ public void setForce(boolean force) {
+ this.force = force;
+ }
+
+ public void setOutputDirectory(File outputDirectory) {
+ this.outputDirectory = outputDirectory;
+ }
+
+ public void setKeepBackup(boolean keepBackup) {
+ this.keepBackup = keepBackup;
+ }
+
+ public void setGenerateBundle(boolean generateBundle) {
+ this.generateBundle = generateBundle;
+ }
+
+ public void setBundleThirdPartyPath(String bundleThirdPartyPath) {
+ this.bundleThirdPartyPath = bundleThirdPartyPath;
+ }
+
+ public void setThirdPartyFileContent(String thirdPartyFileContent) {
+ this.thirdPartyFileContent = thirdPartyFileContent;
+ }
+
+ public void setDoGenerate(boolean doGenerate) {
+ this.doGenerate = doGenerate;
+ }
+
+ public void setThirdPartyFile(File thirdPartyFile) {
+ this.thirdPartyFile = thirdPartyFile;
+ }
+
+ protected class LicenseMap extends TreeMap<String, SortedSet<String>> {
+
+ private static final long serialVersionUID = 864199843545688069L;
+
+ public SortedSet<String> put(String key, String value) {
+ // handle multiple values as a set to avoid duplicates
+ SortedSet<String> valueList = get(key);
+ if (valueList == null) {
+ valueList = new TreeSet<String>();
+ }
+ if (getLog().isDebugEnabled()) {
+ getLog().debug("key:" + key + ",value: " + value);
+ }
+ valueList.add(value);
+ return put(key, valueList);
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyMojo.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-04-16 10:47:43 UTC (rev 1754)
+++ trunk/src/main/java/org/nuiton/license/plugin/UpdateFileHeaderMojo.java 2010-04-16 11:56:15 UTC (rev 1755)
@@ -38,8 +38,8 @@
import java.util.*;
/**
- * The goal to update (or add) the licence header on some files and also update
- * (or add) the project license file.
+ * The goal to update (or add) the header on some files described in
+ * {@link #descriptor} file.
* <p/>
* This goal replace the {@code update-header} goal which can not deal with
* Copyright.
Modified: trunk/src/site/apt/descriptor.apt
===================================================================
--- trunk/src/site/apt/descriptor.apt 2010-04-16 10:47:43 UTC (rev 1754)
+++ trunk/src/site/apt/descriptor.apt 2010-04-16 11:56:15 UTC (rev 1755)
@@ -43,7 +43,7 @@
xsd
- This file is ruled by a {{{./licenseProjectDescriptor-1.0.0.xsd}xsd file}}_.
+ This file is ruled by a {{{./licenseProjectDescriptor-1.0.0.xsd}xsd file}}.
Example
Modified: trunk/src/site/apt/header.apt
===================================================================
--- trunk/src/site/apt/header.apt 2010-04-16 10:47:43 UTC (rev 1754)
+++ trunk/src/site/apt/header.apt 2010-04-16 11:56:15 UTC (rev 1755)
@@ -51,11 +51,17 @@
--------------------------------------------------------------------------------
* (1) the start process tag used to detect begin of header (NEVER suppress it).
+
* (2) Project description section
+
* (3) Header section delimiter
+
* (4) Copyright section of the file (see next section for detail)
+
* (5) Header section delimiter
+
* (6) License section
+
* (7) the end process tag used to detect end of header (NEVER suppress it).
* Configuration
@@ -63,7 +69,9 @@
You can configure those things :
* start process tag
+
* header section delimiter
+
* end process tag
* Copyright model
@@ -135,12 +143,12 @@
Ignore a header
- If you don't want `update-file-header` goal to treate a specific file, you can
- use a specific tag in your class :
+ If you don't want {{{./update-file-header-mojo.html}update-file-header}}
+ goal to treate a specific file, you can use a specific tag in your class :
--------------------------------------------------------------------------------
%%License-Ignore
--------------------------------------------------------------------------------
- You can change it with **ignoreTag** property.
\ No newline at end of file
+ You can change it with <<ignoreTag>> property.
\ No newline at end of file
1
0
Author: tchemit
Date: 2010-04-16 12:47:43 +0200 (Fri, 16 Apr 2010)
New Revision: 1754
Log:
use apt doc (avoid cyclic when wants to release jrst and maven-license-plugin)
Added:
trunk/src/site/apt/
trunk/src/site/apt/descriptor.apt
trunk/src/site/apt/header.apt
trunk/src/site/apt/index.apt
trunk/src/site/apt/usage.apt
Added: trunk/src/site/apt/descriptor.apt
===================================================================
--- trunk/src/site/apt/descriptor.apt (rev 0)
+++ trunk/src/site/apt/descriptor.apt 2010-04-16 10:47:43 UTC (rev 1754)
@@ -0,0 +1,74 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id$
+~~ $HeadURL$
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+License project descriptor
+----
+
+Abstract
+
+
+ This document describes the license project descriptor file introduced in
+ version 2.1.
+
+ The license file descriptor file aims to enumerate all files to include in
+ license process per type and license.
+
+ This new format is used in goal
+ {{{./update-file-header-mojo.html}update-file-header}} and
+ {{{./update-project-license-mojo.html}update-project-license}}.
+
+ TODO-TC-20100409 Do this documentation
+
+xsd
+
+ This file is ruled by a {{{./licenseProjectDescriptor-1.0.0.xsd}xsd file}}_.
+
+Example
+
+ The next example applies a gpl v3 license on all java files in **src/main/java**.
+
+-------------------------------------------------------------------------------
+
+ <?xml version='1.0' encoding='UTF-8'?>
+ <project xmlns="http://maven-site.nuiton.org/maven-license-plugin/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-…">
+ <mainLicense>gpl_v3</mainLicense>
+ <headers>
+ <header>
+ <licenseName>lgpl_v3</licenseName>
+ <commentStyle>java</commentStyle>
+ <fileSets>
+ <fileSet>
+ <basedir>all/src</basedir>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+ </header>
+ </headers>
+ </project>
+-------------------------------------------------------------------------------
\ No newline at end of file
Property changes on: trunk/src/site/apt/descriptor.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/site/apt/header.apt
===================================================================
--- trunk/src/site/apt/header.apt (rev 0)
+++ trunk/src/site/apt/header.apt 2010-04-16 10:47:43 UTC (rev 1754)
@@ -0,0 +1,146 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id$
+~~ $HeadURL$
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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 Header
+----
+
+Abstract
+
+ This document describes the file header model introduced in version 2.1.
+
+ You will learn how to customize it and use it with the goal
+ {{{./update-file-header-mojo.html}update-file-header}}.
+
+Header model
+
+* Example
+
+ Here is an example of a file header (with NO comment box) :
+
+--------------------------------------------------------------------------------
+
+ (1) # % L
+ (2) Project description
+ (3) %%
+ (4) Copyright (C) 2010 your organization
+ (5) %%
+ (6) License content
+ (7) # L %
+--------------------------------------------------------------------------------
+
+ * (1) the start process tag used to detect begin of header (NEVER suppress it).
+ * (2) Project description section
+ * (3) Header section delimiter
+ * (4) Copyright section of the file (see next section for detail)
+ * (5) Header section delimiter
+ * (6) License section
+ * (7) the end process tag used to detect end of header (NEVER suppress it).
+
+* Configuration
+
+ You can configure those things :
+
+ * start process tag
+ * header section delimiter
+ * end process tag
+
+* Copyright model
+
+ Copyright section must exactly be of this form :
+
+--------------------------------------------------------------------------------
+
+ Copyright (C) firstYear[ - lastYear] holder
+--------------------------------------------------------------------------------
+
+ If *firstYear* and *lastYear* are the same then lastYear is omitted.
+
+* Comment box
+
+ In a file, we must box the file header in a comment. In the descriptor file
+ you can customize it by choosing a headerType.
+
+Available comment styles
+
+ Here is the available comment styles.
+
+ Using the goal{{{./comment-style-list-mojo.html}comment-style-list}}
+ you can find all of them.
+
+* java style
+
+--------------------------------------------------------------------------------
+
+ /*
+ * HEADER
+ */
+--------------------------------------------------------------------------------
+
+* xml style
+
+--------------------------------------------------------------------------------
+
+ <!--
+ HEADER
+ -->
+--------------------------------------------------------------------------------
+
+* properties style
+
+--------------------------------------------------------------------------------
+
+ ######
+ # HEADER
+ ######
+--------------------------------------------------------------------------------
+
+* apt style
+
+--------------------------------------------------------------------------------
+
+ ~~~~~~
+ ~~ HEADER
+ ~~~~~~
+--------------------------------------------------------------------------------
+
+* rst style
+
+--------------------------------------------------------------------------------
+ .. -
+ .. * HEADER
+ .. -
+--------------------------------------------------------------------------------
+
+Ignore a header
+
+ If you don't want `update-file-header` goal to treate a specific file, you can
+ use a specific tag in your class :
+
+--------------------------------------------------------------------------------
+
+ %%License-Ignore
+--------------------------------------------------------------------------------
+
+ You can change it with **ignoreTag** property.
\ No newline at end of file
Property changes on: trunk/src/site/apt/header.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/site/apt/index.apt
===================================================================
--- trunk/src/site/apt/index.apt (rev 0)
+++ trunk/src/site/apt/index.apt 2010-04-16 10:47:43 UTC (rev 1754)
@@ -0,0 +1,104 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id$
+~~ $HeadURL$
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+Introduction
+----
+
+Maven license Plugin
+
+ The Maven License Plugin is used to deal with license stuff on a maven project.
+
+* NOTE
+ The process tags are separated by space otherwise plugin can NOT update header of this file!
+
+
+License header
+
+ The license header is a comment added on the top of sources files.
+
+ To detect the header on files we use processor technology, with tags
+
+-------------------------------------------------------------------------------
+
+ # % L Content # L %
+-------------------------------------------------------------------------------
+
+ The header is composed of two parts :
+
+ * the first part gives some common informations for all files of a maven
+ module (such as project name, organisation, ...).
+ * the second part resumes the license used.
+
+ Here a example :
+
+-------------------------------------------------------------------------------
+
+ /*
+ * # % L
+ * Plugin maven de changement de license
+ * %%
+ * Copyright (C) 2008 - 2009 CodeLutin
+ * %%
+ * 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 %
+ */
+-------------------------------------------------------------------------------
+
+* Goals Overview
+
+ The plugin has the following goals:
+
+ * {{{./update-project-license-mojo.html}update-project-license}} adds or updates license project file (since 2.1).
+
+ * {{{./update-file-header-mojo.html}update-file-header}} adds or updates license header on some files (since 2.1).
+
+ * {{{./add-third-party-mojo.html}add-third-party}} creates the THIRD-PARTY.txt in the build.
+
+ * {{{./comment-style-list-mojo.html}comment-style-list}} display list of available comment style header (since 2.1).
+
+ * {{{./license-list-mojo.html}license-list}} display list of available licenses.
+
+ * {{{./help-mojo.html}help}} display help about the plugin (goals, usage).
+
+* Usage
+
+ Instructions on how to use the Plugin can be found on {{{./usage.html}usage}} page
+
+* Examples
+
+ to be done.
+
Property changes on: trunk/src/site/apt/index.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/site/apt/usage.apt
===================================================================
--- trunk/src/site/apt/usage.apt (rev 0)
+++ trunk/src/site/apt/usage.apt 2010-04-16 10:47:43 UTC (rev 1754)
@@ -0,0 +1,144 @@
+~~~
+~~ #%L
+~~ Maven License Plugin
+~~
+~~ $Id$
+~~ $HeadURL$
+~~ %%
+~~ Copyright (C) 2008 - 2010 CodeLutin
+~~ %%
+~~ 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%
+~~~
+----
+Usage
+----
+
+Actions
+
+* update-project-license goal
+
+ This goal creates or updates the LICENSE.txt file and add it in build.
+
+ It can also generate a bundle License file to avoid name collision in a final
+ application.
+
+ for full detail see {{{./update-project-license-mojo.html}detail page}}.
+
+* update-file-header goal
+
+ This goal adds or updates the license header on some files using a xml
+ descriptor file to describe all files to include in license process for a
+ whole module.
+
+ for full detail see {{{./update-file-header-mojo.html}detail page}}.
+
+* add-third-party goal
+
+ This goal build the THIRD-PARTY.txt file and add it in build.
+
+ for full detail see {{{./add-third-party-mojo.html}detail page}}.
+
+Get informations
+
+* license-list goal
+
+ This goal display of available licenses.
+
+ Use it directly (and only) from commandline :
+
+-------------------------------------------------------------------------------
+
+ mvn license:license-list
+-------------------------------------------------------------------------------
+
+ To display the license header, use the <<detail>> parameter :
+
+-------------------------------------------------------------------------------
+ mvn license:license-list -Ddetail
+-------------------------------------------------------------------------------
+
+ for full detail see {{{./license-list-mojo.html}detail page}}.
+
+** Example of execution
+
+-------------------------------------------------------------------------------
+ [INFO] [license:license-list {execution: default-cli}]
+ [INFO] Available licenses :
+
+ * agpl_v3 : GNU Affero General Public License (AGPL) version 3.0
+ * apache_v2 : Apache License version 2.0
+ * cddl_v1 : COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+ * fdl_v1_3 : GNU Free Documentation License (FDL) version 1.3
+ * gpl_v1 : GNU General Public License (GPL) version 1.0
+ * gpl_v2 : GNU General Public License (GPL) version 2.0
+ * gpl_v3 : GNU General Public License (GPL) version 3.0
+ * lgpl_v2_1 : GNU General Lesser Public License (LGPL) version 2.1
+ * lgpl_v3 : GNU General Lesser Public License (LGPL) version 3.0
+ * mit : MIT-License
+-------------------------------------------------------------------------------
+
+* comment-style-list goal
+
+ This goal display of available comment style to box file header.
+
+ Use it directly (and only) from commandline :
+
+-------------------------------------------------------------------------------
+
+ mvn license:comment-style-list
+-------------------------------------------------------------------------------
+
+ To display the example, use the <<detail>> parameter :
+
+-------------------------------------------------------------------------------
+
+ mvn license:comment-style-list -Ddetail
+-------------------------------------------------------------------------------
+
+ for full detail see {{{./comment-style-list-mojo.html}detail page}}.
+
+** Example of execution
+
+-------------------------------------------------------------------------------
+ [INFO] [license:comment-style-list {execution: default-cli}]
+ [INFO] List of available comment styles:
+
+ - apt : header transformer with apt comment style
+ - java : header transformer with java comment style
+ - properties : header transformer with properties file comment style
+ - rst : header transformer with rst comment style
+ - xml : header transformer with xml comment style
+-------------------------------------------------------------------------------
+
+* help goal
+
+ This goal display the help of the plugin (available goals).
+
+ Use it directly (and only) from commandline :
+
+-------------------------------------------------------------------------------
+
+ mvn license:help
+-------------------------------------------------------------------------------
+
+ To display verbose help :
+
+-------------------------------------------------------------------------------
+
+ mvn license:help -Ddetail
+-------------------------------------------------------------------------------
+
+ for full detail see {{{./help-mojo.html}detail page}}.
Property changes on: trunk/src/site/apt/usage.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
1
0
Author: tchemit
Date: 2010-04-16 12:47:28 +0200 (Fri, 16 Apr 2010)
New Revision: 1753
Log:
use apt doc (avoid cyclic when wants to release jrst and maven-license-plugin)
Removed:
trunk/src/site/rst/
Modified:
trunk/pom.xml
trunk/src/license/project.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-04-15 19:00:41 UTC (rev 1752)
+++ trunk/pom.xml 2010-04-16 10:47:28 UTC (rev 1753)
@@ -332,6 +332,8 @@
<properties>
+ <siteSourcesType>apt</siteSourcesType>
+
<processor.version>1.0.2</processor.version>
<!-- version of project license descriptor model -->
@@ -403,7 +405,7 @@
</plugins>
- <pluginManagement>
+ <!--pluginManagement>
<plugins>
<plugin>
@@ -424,7 +426,7 @@
</plugin>
</plugins>
- </pluginManagement>
+ </pluginManagement-->
</build>
Modified: trunk/src/license/project.xml
===================================================================
--- trunk/src/license/project.xml 2010-04-15 19:00:41 UTC (rev 1752)
+++ trunk/src/license/project.xml 2010-04-16 10:47:28 UTC (rev 1753)
@@ -48,10 +48,10 @@
</header>
<header>
- <commentStyle>rst</commentStyle>
+ <commentStyle>apt</commentStyle>
<fileSet>
<basedir>src/site</basedir>
- <include>**/*.rst</include>
+ <include>**/*.apt</include>
</fileSet>
</header>
1
0
15 Apr '10
Author: tchemit
Date: 2010-04-15 21:00:41 +0200 (Thu, 15 Apr 2010)
New Revision: 1752
Log:
- Anomalie #526: rst and apt header are not stable
- fix rst headers
- uniformize add-thrid-party with update-project-license
Added:
trunk/src/it/update-file-header/src/files/
trunk/src/it/update-file-header/src/files/apt/
trunk/src/it/update-file-header/src/files/apt/index.apt
trunk/src/it/update-file-header/src/files/apt/index2.apt
trunk/src/it/update-file-header/src/files/properties/
trunk/src/it/update-file-header/src/files/properties/test.properties
trunk/src/it/update-file-header/src/files/properties/test2.properties
trunk/src/it/update-file-header/src/files/rst/
trunk/src/it/update-file-header/src/files/rst/index.rst
trunk/src/it/update-file-header/src/files/rst/index2.rst
trunk/src/it/update-file-header/src/files/xml/
trunk/src/it/update-file-header/src/files/xml/test.xml
trunk/src/it/update-file-header/src/files/xml/test2.xml
Modified:
trunk/src/it/update-file-header/pom.xml
trunk/src/it/update-file-header/src/license/project.xml
trunk/src/it/update-file-header/verify.groovy
trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java
trunk/src/main/java/org/nuiton/license/plugin/header/transformer/AbstractFileHeaderTransformer.java
trunk/src/site/rst/descriptor.rst
trunk/src/site/rst/header.rst
trunk/src/site/rst/index.rst
trunk/src/site/rst/usage.rst
Modified: trunk/src/it/update-file-header/pom.xml
===================================================================
--- trunk/src/it/update-file-header/pom.xml 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/it/update-file-header/pom.xml 2010-04-15 19:00:41 UTC (rev 1752)
@@ -43,6 +43,7 @@
<version>@pom.version@</version>
<configuration>
<verbose>true</verbose>
+ <addSvnKeyWords>true</addSvnKeyWords>
</configuration>
<executions>
<execution>
Added: trunk/src/it/update-file-header/src/files/apt/index.apt
===================================================================
--- trunk/src/it/update-file-header/src/files/apt/index.apt (rev 0)
+++ trunk/src/it/update-file-header/src/files/apt/index.apt 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1 @@
+My file
Property changes on: trunk/src/it/update-file-header/src/files/apt/index.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/apt/index2.apt
===================================================================
--- trunk/src/it/update-file-header/src/files/apt/index2.apt (rev 0)
+++ trunk/src/it/update-file-header/src/files/apt/index2.apt 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1,25 @@
+~~~
+~~ #%L
+~~ License Test :: update-file-header
+~~
+~~ $Id$
+~~ $HeadURL$
+~~ %%
+~~ Copyright (C) 2012 License Test
+~~ %%
+~~ This program is free software: you can redistribute it and/or modify
+~~ it under the terms of the GNU 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 Public License for more details.
+~~
+~~ You should have received a copy of the GNU General Public
+~~ License along with this program. If not, see
+~~ <http://www.gnu.org/licenses/gpl-3.0.html>.
+~~ #L%
+~~~
+My file
Property changes on: trunk/src/it/update-file-header/src/files/apt/index2.apt
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/properties/test.properties
===================================================================
--- trunk/src/it/update-file-header/src/files/properties/test.properties (rev 0)
+++ trunk/src/it/update-file-header/src/files/properties/test.properties 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1 @@
+my.key=true
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/properties/test.properties
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/properties/test2.properties
===================================================================
--- trunk/src/it/update-file-header/src/files/properties/test2.properties (rev 0)
+++ trunk/src/it/update-file-header/src/files/properties/test2.properties 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1,26 @@
+###
+# #%L
+# License Test :: update-file-header
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2012 License Test
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU 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 Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/gpl-3.0.html>.
+# #L%
+###
+
+my.key=true
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/properties/test2.properties
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/rst/index.rst
===================================================================
--- trunk/src/it/update-file-header/src/files/rst/index.rst (rev 0)
+++ trunk/src/it/update-file-header/src/files/rst/index.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1 @@
+My File
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/rst/index.rst
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/rst/index2.rst
===================================================================
--- trunk/src/it/update-file-header/src/files/rst/index2.rst (rev 0)
+++ trunk/src/it/update-file-header/src/files/rst/index2.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1,26 @@
+My file
+
+.. -
+.. * #%L
+.. * Maven License Plugin
+.. *
+.. * $Id$
+.. * $HeadURL$
+.. * %%
+.. * Copyright (C) 2008 - 2010 CodeLutin
+.. * %%
+.. * 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%
+..
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/rst/index2.rst
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/xml/test.xml
===================================================================
--- trunk/src/it/update-file-header/src/files/xml/test.xml (rev 0)
+++ trunk/src/it/update-file-header/src/files/xml/test.xml 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1,2 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<yo/>
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/xml/test.xml
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/src/it/update-file-header/src/files/xml/test2.xml
===================================================================
--- trunk/src/it/update-file-header/src/files/xml/test2.xml (rev 0)
+++ trunk/src/it/update-file-header/src/files/xml/test2.xml 2010-04-15 19:00:41 UTC (rev 1752)
@@ -0,0 +1,27 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+ #%L
+ License Test :: update-file-header
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2012 License Test
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU 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 Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/gpl-3.0.html>.
+ #L%
+ -->
+
+<yo/>
\ No newline at end of file
Property changes on: trunk/src/it/update-file-header/src/files/xml/test2.xml
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/src/it/update-file-header/src/license/project.xml
===================================================================
--- trunk/src/it/update-file-header/src/license/project.xml 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/it/update-file-header/src/license/project.xml 2010-04-15 19:00:41 UTC (rev 1752)
@@ -3,11 +3,47 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-…">
<mainLicense>gpl_v3</mainLicense>
- <header>
- <commentStyle>java</commentStyle>
- <fileSet>
- <basedir>src/main/java</basedir>
- <include>**/*.java</include>
- </fileSet>
- </header>
+ <headers>
+
+ <header>
+ <commentStyle>java</commentStyle>
+ <fileSet>
+ <basedir>src/main/java</basedir>
+ <include>**/*.java</include>
+ </fileSet>
+ </header>
+
+ <header>
+ <commentStyle>apt</commentStyle>
+ <fileSet>
+ <basedir>src/files</basedir>
+ <include>**/*.apt</include>
+ </fileSet>
+ </header>
+
+ <header>
+ <commentStyle>rst</commentStyle>
+ <fileSet>
+ <basedir>src/files</basedir>
+ <include>**/*.rst</include>
+ </fileSet>
+ </header>
+
+ <header>
+ <commentStyle>xml</commentStyle>
+ <fileSet>
+ <basedir>src/files</basedir>
+ <include>**/*.xml</include>
+ </fileSet>
+ </header>
+
+ <header>
+ <commentStyle>properties</commentStyle>
+ <fileSet>
+ <basedir>src/files</basedir>
+ <include>**/*.properties</include>
+ </fileSet>
+ </header>
+
+ </headers>
</project>
Modified: trunk/src/it/update-file-header/verify.groovy
===================================================================
--- trunk/src/it/update-file-header/verify.groovy 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/it/update-file-header/verify.groovy 2010-04-15 19:00:41 UTC (rev 1752)
@@ -21,4 +21,91 @@
assert content.contains( ' * yet another license' );
assert content.contains( ' * Copyright (C) 2000 Codelutin Do not update!' );
+file = new File(basedir, 'src/files/apt/index.apt');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '~~ #%L' );
+assert content.contains( '~~ #L%' );
+assert content.contains( '$Id' );
+assert ! content.contains( '~~ ~~');
+
+
+file = new File(basedir, 'src/files/apt/index2.apt');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '~~ #%L' );
+assert content.contains( '~~ #L%' );
+assert content.contains( '$Id' );
+assert ! content.contains( '~~ ~~');
+
+
+file = new File(basedir, 'src/files/rst/index.rst');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '.. * #%L' );
+assert content.contains( '.. * #L%' );
+assert content.contains( '$Id' );
+assert ! content.contains( '.. * .. *');
+
+
+file = new File(basedir, 'src/files/rst/index2.rst');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '.. * #%L' );
+assert content.contains( '.. * #L%' );
+assert content.contains( '$Id' );
+assert ! content.contains( '.. * .. *');
+
+
+file = new File(basedir, 'src/files/xml/test.xml');
+assert file.exists();
+
+content = file.text;
+assert content.startsWith( "<?xml version='1.0' encoding='UTF-8'?>" );
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '#%L' );
+assert content.contains( '#L%' );
+assert content.contains( '$Id' );
+
+
+file = new File(basedir, 'src/files/xml/test2.xml');
+assert file.exists();
+
+content = file.text;
+assert content.startsWith( "<?xml version='1.0' encoding='UTF-8'?>" );
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '#%L' );
+assert content.contains( '#L%' );
+assert content.contains( '$Id' );
+
+file = new File(basedir, 'src/files/properties/test.properties');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '# #%L' );
+assert content.contains( '# #L%' );
+assert !content.contains( '# # \n' );
+assert content.contains( '$Id' );
+
+
+file = new File(basedir, 'src/files/properties/test2.properties');
+assert file.exists();
+
+content = file.text;
+assert content.contains( 'Copyright (C)' );
+assert content.contains( '# #%L' );
+assert content.contains( '# #L%' );
+assert content.contains( '# #%L' );
+assert !content.contains( '# # \n' );
+assert content.contains( '$Id' );
+
return true;
Modified: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-15 19:00:41 UTC (rev 1752)
@@ -103,10 +103,21 @@
*
* @parameter expression="${license.generateBundle}" default-value="false"
* @since 1.0.0
+ * @deprecated since 2.2 (use instead {@code generateBundle}
*/
+ @Deprecated
protected boolean copyToMETA_INF;
/**
+ * Un flag pour faire une copie nommé dans META-INF (prefixe avec le nom de
+ * l'artifact).
+ *
+ * @parameter expression="${license.generateBundle}" default-value="false"
+ * @since 1.0.0
+ */
+ protected boolean generateBundle;
+
+ /**
* Local Repository.
*
* @parameter expression="${localRepository}"
@@ -184,6 +195,10 @@
setVerbose(true);
}
+ if (copyToMETA_INF) {
+ generateBundle = true;
+ }
+
doGenerate = true;
thirdPartyFile = new File(outputDirectory, thirdPartyFilename);
@@ -235,7 +250,7 @@
}
writeFile(thirdPartyFile, thirdPartyFileContent, getEncoding());
}
- if (copyToMETA_INF) {
+ if (generateBundle) {
copyFile(thirdPartyFile, new File(
outputDirectory,
"META-INF" + File.separator + getProject().getArtifactId() +
Modified: trunk/src/main/java/org/nuiton/license/plugin/header/transformer/AbstractFileHeaderTransformer.java
===================================================================
--- trunk/src/main/java/org/nuiton/license/plugin/header/transformer/AbstractFileHeaderTransformer.java 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/main/java/org/nuiton/license/plugin/header/transformer/AbstractFileHeaderTransformer.java 2010-04-15 19:00:41 UTC (rev 1752)
@@ -284,6 +284,15 @@
// remove comment prefix
line = line.substring(index + prefixLength);
+ } else {
+ String s = getCommentLinePrefix().trim();
+ if (line.startsWith(s)) {
+ if (line.length() <= s.length()) {
+ line = "";
+ }
+ } else {
+ line = line.substring(s.length());
+ }
}
buffer.append(line).append(LINE_SEPARATOR);
}
Modified: trunk/src/site/rst/descriptor.rst
===================================================================
--- trunk/src/site/rst/descriptor.rst 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/site/rst/descriptor.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -13,7 +13,7 @@
.. -
.. * #%L
.. * Maven License Plugin
-.. * .. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
Modified: trunk/src/site/rst/header.rst
===================================================================
--- trunk/src/site/rst/header.rst 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/site/rst/header.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -13,7 +13,7 @@
.. -
.. * #%L
.. * Maven License Plugin
-.. * .. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
Modified: trunk/src/site/rst/index.rst
===================================================================
--- trunk/src/site/rst/index.rst 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/site/rst/index.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -13,7 +13,7 @@
.. -
.. * #%L
.. * Maven License Plugin
-.. * .. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
Modified: trunk/src/site/rst/usage.rst
===================================================================
--- trunk/src/site/rst/usage.rst 2010-04-15 13:57:24 UTC (rev 1751)
+++ trunk/src/site/rst/usage.rst 2010-04-15 19:00:41 UTC (rev 1752)
@@ -12,7 +12,7 @@
.. -
.. * #%L
.. * Maven License Plugin
-.. * .. *
+.. *
.. * $Id$
.. * $HeadURL$
.. * %%
1
0