Author: tchemit Date: 2010-04-09 22:20:38 +0200 (Fri, 09 Apr 2010) New Revision: 850 Log: add update-license profile Added: trunk/src/license/ trunk/src/license/project.xml Modified: trunk/pom.xml trunk/src/site/apt/profiles.apt Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-04-09 19:45:31 UTC (rev 849) +++ trunk/pom.xml 2010-04-09 20:20:38 UTC (rev 850) @@ -1056,6 +1056,66 @@ </distributionManagement> </profile> + <!-- This profile update license stuff with new goal update-license --> + <profile> + <id>update-license</id> + <activation> + <property> + <name>updateLicense</name> + <value>true</value> + </property> + </activation> + + <properties> + <license.descriptor>src/license/project.xml</license.descriptor> + </properties> + <build> + <defaultGoal>process-resources</defaultGoal> + <plugins> + + <plugin> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>check-license</id> + <goals> + <goal>enforce</goal> + </goals> + <phase>initialize</phase> + <configuration> + <rules> + <requireFilesExist> + <files> + <file>${license.descriptor}</file> + </files> + </requireFilesExist> + </rules> + <ignoreCache>true</ignoreCache> + <failFast>true</failFast> + <fail>true</fail> + + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-license-plugin</artifactId> + <executions> + <execution> + <id>update-license</id> + <goals> + <goal>update-license</goal> + </goals> + <phase>process-resources</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + <!-- ce profile permet de generer les entetes de licenses pour les fichiers java --> <profile> Added: trunk/src/license/project.xml =================================================================== --- trunk/src/license/project.xml (rev 0) +++ trunk/src/license/project.xml 2010-04-09 20:20:38 UTC (rev 850) @@ -0,0 +1,30 @@ +<?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/licenseProject-1.0.0.xsd"> + <mainLicense>lgpl_v3</mainLicense> + <licenseSets> + <licenseSet> + <!--<licenseName>lgpl_v3</licenseName>--> + <fileSets> + + <fileSet> + <headerType>apt</headerType> + <basedir>src/site</basedir> + <includes> + <include>**/*.apt</include> + </includes> + </fileSet> + + <fileSet> + <headerType>xml</headerType> + <basedir>src/site</basedir> + <includes> + <include>**/*.xml</include> + </includes> + </fileSet> + + </fileSets> + </licenseSet> + </licenseSets> +</project> Modified: trunk/src/site/apt/profiles.apt =================================================================== --- trunk/src/site/apt/profiles.apt 2010-04-09 19:45:31 UTC (rev 849) +++ trunk/src/site/apt/profiles.apt 2010-04-09 20:20:38 UTC (rev 850) @@ -55,6 +55,8 @@ *----------------------------------+------------------------------+ | {{run}} | <<->> | *----------------------------------+------------------------------+ +| {{update-license}} | <<updateLicense>> | +*----------------------------------+------------------------------+ | {{update-java-header}} | <<updateJavaHeader>> | *----------------------------------+------------------------------+ | {{update-properties-header}} | <<updatePropertiesHeader>> | @@ -199,7 +201,31 @@ mvn package -PdoLocalWebstart -------------------------------------------------------------------------------- +* {update-license} + Ce profile permet la mise à jour des entêtes de tous les fichiers d'un + projet en utilisant le nouveau goal <update-license> (depuis maven-license-plugin 2.1). + + Il faut avoir définit un fichier + +-------------------------------------------------------------------------------- +license.descriptor +-------------------------------------------------------------------------------- + + qui est par defaut <<src/license/project.xml>>. + + Ce fichier décrit les en-têtes à inspecter. + +-------------------------------------------------------------------------------- +mvn -Pupdate-license +-------------------------------------------------------------------------------- + + ou + +-------------------------------------------------------------------------------- +mvn -DupdateLicense +-------------------------------------------------------------------------------- + * {update-java-header} Ce profile permet la mise à jour des entêtes de tous les fichiers java d'un