Author: ymartel Date: 2010-10-01 18:19:39 +0200 (Fri, 01 Oct 2010) New Revision: 1834 Url: http://nuiton.org/repositories/revision/maven-license-plugin/1834 Log: Add documentation on maven site about the new update-file-header processus, without descriptor file Added: trunk/src/site/apt/update-file-header-config.apt trunk/src/site/fr/apt/update-file-header-config.apt Modified: trunk/src/site/apt/descriptor.apt trunk/src/site/apt/usage.apt trunk/src/site/fr/apt/descriptor.apt trunk/src/site/fr/apt/usage.apt Modified: trunk/src/site/apt/descriptor.apt =================================================================== --- trunk/src/site/apt/descriptor.apt 2010-10-01 09:33:48 UTC (rev 1833) +++ trunk/src/site/apt/descriptor.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -26,6 +26,11 @@ License project descriptor ---- +Warning + + <Since version 2.4>, <<the descriptor file is no more mandatory. It will be removed + from version 3.>> + Abstract Added: trunk/src/site/apt/update-file-header-config.apt =================================================================== --- trunk/src/site/apt/update-file-header-config.apt (rev 0) +++ trunk/src/site/apt/update-file-header-config.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -0,0 +1,189 @@ +~~~ +~~ #%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% +~~~ +---- +Update File Header: Configuration +---- + + <Since version 2.4>, without a descriptor file, we can configure the + update-file-header goal with four parameters: + + * licenseName : it is the name of the license to add on file header. It is mandatory, + + * roots : it is a list of the main directories from which we apply the + license on files. The default roots is <src>, + + * includes : List of files to include, gived by a regexp (for example: <*Dao.java>). + The default include is **/*, + + * excludes: List of files to exclude, gived by a regexp (for example: <*Test.java>). + The default excludes are i18n properties (**/i18n/*.properties). + + The treated extensions are: java, xml, rst, properties and apt. + +Roots + + By default, All the files in <src> are treated. This could be changed with the + property <roots>. The roots property is a list of based directory from which the + update-file-header will be applied. + +* Exemple + + Given a pom with these plugin configuration + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <roots> + <param>src/main/java</param> + <param>src/test</param> + </roots> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + +------------------------------------------------------------------------------- + Considering we have the following arborescence: + src/main/java + src/main/resources + src/test/java + src/test/resources +------------------------------------------------------------------------------- + Only files from src/main/java, src/test/java and src/test/resources will be treated. + + +Includes + + Par défault, Tous les fichiers depuis le(s) roots et avec la bonne extension + sont traités. Avec le parametre de type Liste <includes>, il est possible de + spécifier avec plus de precision quels fichiers on désire traiter. + +* Exemple + + Soit un pom avec la configuration de plugin suivante: + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <includes> + <param>*Dao.java</param> + <param>*Bean.java</param> + <param>.*entities.*.xml</param> + </includes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + + Le goal update-file-header sera appliqué uniquement aux fichiers java (depuis + "src") dont le nom se termine par <"Dao"> ou <"Bean"> et aux fichiers xml contenant + <"entities"> dans leur nom. + + +Excludes + + Le parametre <excludes> permet d'ignorer certains fichiers lors du processus + update-file-header. + +* Exemple + + Soit un pom avec la configuration de plugin suivante: + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <excludes> + <param>*.png</param> + <param>*.txt</param> + <param>*Test.java</param> + </excludes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + + Les fichiers Java dont le nom se terminent par "Test", les fichiers png et txt + seront ignorés. + Modified: trunk/src/site/apt/usage.apt =================================================================== --- trunk/src/site/apt/usage.apt 2010-10-01 09:33:48 UTC (rev 1833) +++ trunk/src/site/apt/usage.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -47,6 +47,14 @@ for full detail see {{{./update-file-header-mojo.html}detail page}}. +* configuration + + In case of any descriptor file, all the <*.java *.rst *.xml et *.properties> + files from <"src/**/*"> are treated. However, it is necessary to give the license + to use, with the parameter <licenseName>. + + for full detail see {{{./update-file-header-config.html}detail page}}. + Third-party The project offers some goals to deal with THIRD-PARTY files in a project. Modified: trunk/src/site/fr/apt/descriptor.apt =================================================================== --- trunk/src/site/fr/apt/descriptor.apt 2010-10-01 09:33:48 UTC (rev 1833) +++ trunk/src/site/fr/apt/descriptor.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -26,6 +26,11 @@ License project descriptor ---- +Attention + + <Depuis la version 2.4>, <<le fichier de description n'est plus obligatoire. Il + sera supprimé avec la version 3.>> + Abstract Ce document décrit le fichier de description de license introduit dans la Added: trunk/src/site/fr/apt/update-file-header-config.apt =================================================================== --- trunk/src/site/fr/apt/update-file-header-config.apt (rev 0) +++ trunk/src/site/fr/apt/update-file-header-config.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -0,0 +1,190 @@ +~~~ +~~ #%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% +~~~ +---- +Update File Header: Configuration +---- + + <Depuis la version 2.4>, en l'absence de fichier descriptor, il est possible de + configurer le goal update-file-header avec quatre four parametres: + + * licenseName : il s'agit du nom de la license à appliquer aux fichiers. + Ce parametre est obligatoire, + + * roots : C'est la liste des "main directories" à partir desquels il faut + appliquer la licence sur les fichiers. Par défault, il s'agit de <src>, + + * includes : Liste des fichiers à traiter, renseignés à l'air d'une regexp + (par exemple: <*Dao.java>). Par défault, les fichiers traités répondent à **/*, + + * excludes: Liste des fichiers à ignorer, renseignés par le biais d'une regexp + (par exemple: <*Test.java>). Par défault, les fichier "properties" de i18n + (**/i18n/*.properties). + + Les extensiosn traités sont: .java, .xml, .rst, .properties et .apt. + +Roots + + Par défault, tous les fichiers contenus dans <src> sont traités. Cela peut se + changer en utilisant la propriété <roots>. Cette propriété est une liste de + répertoires de bases au sein desquels le goal update-file-header sera appliquée. + +* Example + + Soit un pom avec la configuration de plugin suivante: + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <roots> + <param>src/main/java</param> + <param>src/test</param> + </roots> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + +------------------------------------------------------------------------------- + En considérant que nous avons l'arboresence suivante: + src/main/java + src/main/resources + src/test/java + src/test/resources + ------------------------------------------------------------------------------- + Seuls les fichiers inclus dans src/main/java, src/test/java et src/test/resources + seront traités. + + +Includes + + By default, all the files from the roots and with the adequate extension are treated. + With the list parameters <includes>, we can specify with more precision which + files we want to deals. + +* Example + + Soit un pom avec la configuration de plugin suivante: + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <includes> + <param>*Dao.java</param> + <param>*Bean.java</param> + <param>.*entities.*.xml</param> + </includes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + + The update-file-header will be done only on java files (from "src") ending with + <"Dao"> and <"Bean"> and on xml files containing <"entities"> in their file name. + + +Excludes + + The excludes parameter allows to ignore some file in the update-file-header process. + +* Example + + Given a pom with these plugin configuration + +------------------------------------------------------------------------------- + + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <version>2.4</version> + <configuration> + <verbose>false</verbose> + <addSvnKeyWords>true</addSvnKeyWords> + </configuration> + <executions> + <execution> + <id>first</id> + <goals> + <goal>update-file-header</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <licenseName>gpl_v3</licenseName> + <excludes> + <param>*.png</param> + <param>*.txt</param> + <param>*Test.java</param> + </excludes> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + +------------------------------------------------------------------------------- + + The java files ending with "Test", the png files and the txt files will be + ignored by the update-file-header goal. + Modified: trunk/src/site/fr/apt/usage.apt =================================================================== --- trunk/src/site/fr/apt/usage.apt 2010-10-01 09:33:48 UTC (rev 1833) +++ trunk/src/site/fr/apt/usage.apt 2010-10-01 16:19:39 UTC (rev 1834) @@ -50,6 +50,15 @@ Pour plus d'informations, référez-vous à {{{./update-file-header-mojo.html}la page de détail}}. +* configuration + + Par défaut, en l'absence de fichier descripteur, tous les fichiers <*.java + *.rst *.xml et *.properties> contenus dans <"src/**/*"> sont traités. Il est cependant + nécessaire de préciser la license à utiliser, par le parametre <licenseName>. + + Pour plus d'informations, référez-vous à + {{{./update-file-header-config.html}la page de détail}}. + Third-party Le projet offre des goals pour traiter les THIRD-PARTY d'un projet.