Author: tchemit Date: 2010-04-09 20:35:55 +0200 (Fri, 09 Apr 2010) New Revision: 1725 Log: - add comment-style-list goal - deprecates generator-list goal - clean log configuration - begin documentation Added: trunk/src/main/java/org/nuiton/license/plugin/CommentStyleListMojo.java trunk/src/site/rst/header.rst Modified: trunk/pom.xml trunk/src/main/java/org/nuiton/license/plugin/AddLicenseFileMojo.java trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java trunk/src/main/java/org/nuiton/license/plugin/GeneratorListMojo.java trunk/src/main/java/org/nuiton/license/plugin/LicenseListMojo.java trunk/src/main/java/org/nuiton/license/plugin/UpdateLicenseMojo.java trunk/src/main/resources/log4j.properties trunk/src/site/rst/index.rst trunk/src/site/rst/usage.rst trunk/src/site/site_en.xml Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/pom.xml 2010-04-09 18:35:55 UTC (rev 1725) @@ -3,481 +3,486 @@ 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> + <modelVersion>4.0.0</modelVersion> - <!-- ************************************************************* --> - <!-- *** POM Relationships *************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** POM Relationships *************************************** --> + <!-- ************************************************************* --> - <parent> - <groupId>org.nuiton</groupId> - <artifactId>mavenpom4redmine</artifactId> - <version>2.0.7</version> - </parent> + <parent> + <groupId>org.nuiton</groupId> + <artifactId>mavenpom4redmine</artifactId> + <version>2.0.7</version> + </parent> - <artifactId>maven-license-plugin</artifactId> - <version>2.1-SNAPSHOT</version> + <artifactId>maven-license-plugin</artifactId> + <version>2.1-SNAPSHOT</version> - <dependencies> + <dependencies> - <dependency> - <groupId>org.nuiton.processor</groupId> - <artifactId>nuiton-processor</artifactId> - <version>${processor.version}</version> - <scope>compile</scope> - </dependency> + <dependency> + <groupId>org.nuiton.processor</groupId> + <artifactId>nuiton-processor</artifactId> + <version>${processor.version}</version> + <scope>compile</scope> + </dependency> - <dependency> - <groupId>org.nuiton</groupId> - <artifactId>maven-helper-plugin</artifactId> - <version>${helper.version}</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact</artifactId> - </exclusion> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact-manager</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-artifact-manager</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-model</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-model</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-profile</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-profile</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-settings</artifactId> - </exclusion> - <exclusion> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + </exclusion> + <exclusion> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-simple</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-simple</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-api</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-api</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-javamail</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-javamail</artifactId> + </exclusion> - <exclusion> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - </exclusion> + <exclusion> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + </exclusion> - <exclusion> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-cipher</artifactId> - </exclusion> + <exclusion> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-cipher</artifactId> + </exclusion> - <exclusion> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-sec-dispatcher</artifactId> - </exclusion> + <exclusion> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + </exclusion> - </exclusions> - </dependency> + </exclusions> + </dependency> - <!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas --> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.5.15</version> - <scope>compile</scope> - </dependency> + <!-- FIXME si on ne le rajoute pas, on se retrouve avec la version 1.1 qui ne convient pas --> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.5.15</version> + <scope>compile</scope> + </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-project</artifactId> - <version>${maven.version}</version> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-project</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-plugin-api</artifactId> - <version>${maven.version}</version> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-plugin-api</artifactId> + <version>${maven.version}</version> + <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>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> - <version>1.2.14</version> - </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.14</version> + </dependency> - <!-- tests dependencies --> + <!-- tests dependencies --> - <dependency> - <groupId>org.nuiton</groupId> - <artifactId>maven-helper-plugin</artifactId> - <version>${helper.version}</version> - <scope>test</scope> - <classifier>tests</classifier> - <exclusions> + <dependency> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>${helper.version}</version> + <scope>test</scope> + <classifier>tests</classifier> + <exclusions> - <exclusion> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-dependency-tree</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-dependency-tree</artifactId> + </exclusion> - <exclusion> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - </exclusion> + <exclusion> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-simple</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-simple</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-api</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-api</artifactId> + </exclusion> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-javamail</artifactId> - </exclusion> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-javamail</artifactId> + </exclusion> - <exclusion> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - </exclusion> + <exclusion> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + </exclusion> - <exclusion> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-cipher</artifactId> - </exclusion> + <exclusion> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-cipher</artifactId> + </exclusion> - <exclusion> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-sec-dispatcher</artifactId> - </exclusion> + <exclusion> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + </exclusion> - </exclusions> - </dependency> + </exclusions> + </dependency> - <dependency> - <groupId>org.apache.maven.plugin-testing</groupId> - <artifactId>maven-plugin-testing-harness</artifactId> - <version>1.2</version> - <scope>test</scope> - <exclusions> + <dependency> + <groupId>org.apache.maven.plugin-testing</groupId> + <artifactId>maven-plugin-testing-harness</artifactId> + <version>1.2</version> + <scope>test</scope> + <exclusions> - <exclusion> - <groupId>org.apache.maven.reporting</groupId> - <artifactId>maven-reporting-api</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven</groupId> - <artifactId>maven-monitor</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-file</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-http-lightweight</artifactId> - </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-ssh</artifactId> - </exclusion> - <exclusion> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-archiver</artifactId> - </exclusion> - <exclusion> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-api</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.maven</groupId> + <artifactId>maven-monitor</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + </exclusion> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-archiver</artifactId> + </exclusion> + <exclusion> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + </exclusion> - </exclusions> - </dependency> + </exclusions> + </dependency> - <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.7</version> - <scope>test</scope> - </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.7</version> + <scope>test</scope> + </dependency> - </dependencies> + </dependencies> - <!-- ************************************************************* --> - <!-- *** Project Information ************************************* --> - <!-- ************************************************************* --> - <name>Maven License Plugin</name> + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + <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. - </description> - <inceptionYear>2008</inceptionYear> - <url>http://maven-site.nuiton.org/maven-license-plugin</url> + <description> + Plugin pour mettre à jour l'en-tête des fichiers (avec la license + choisie) + dans un module maven 2. + </description> + <inceptionYear>2008</inceptionYear> + <url>http://maven-site.nuiton.org/maven-license-plugin</url> - <developers> + <developers> - <developer> - <name>Tony Chemit</name> - <id>tchemit</id> - <email>chemit@codelutin.com</email> - <organization>CodeLutin</organization> - <timezone>+2</timezone> - <roles> - <role>Développeur</role> - </roles> - </developer> - </developers> + <developer> + <name>Tony Chemit</name> + <id>tchemit</id> + <email>chemit@codelutin.com</email> + <organization>CodeLutin</organization> + <timezone>+2</timezone> + <roles> + <role>Développeur</role> + </roles> + </developer> + </developers> - <!-- ************************************************************* --> - <!-- *** Build Environment ************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Environment ************************************** --> + <!-- ************************************************************* --> - <!-- 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> - </scm> + <!-- 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> + </scm> - <!-- ************************************************************* --> - <!-- *** Build Settings ****************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> - <packaging>maven-plugin</packaging> + <packaging>maven-plugin</packaging> - <properties> + <properties> - <processor.version>1.0.2</processor.version> - <helper.version>1.2.3-SNAPSHOT</helper.version> - <mdoVersion>1.0.0</mdoVersion> - - <!-- documentation is in english --> - <siteLocales>en</siteLocales> + <processor.version>1.0.2</processor.version> + + <!-- TODO Remove this when mavenpom greater than 2.8 --> + <helper.version>1.2.3-SNAPSHOT</helper.version> - </properties> + <!-- version of project license descriptor model --> + <mdoVersion>1.0.0</mdoVersion> - <build> + <!-- documentation is in english --> + <siteLocales>en</siteLocales> - <plugins> + </properties> - <!-- generate descriptor model + reader --> - <plugin> - <groupId>org.codehaus.modello</groupId> - <artifactId>modello-maven-plugin</artifactId> - <version>1.0</version> - <configuration> - <version>${mdoVersion}</version> - <lineLength>80</lineLength> - <useJava5>true</useJava5> - </configuration> - <executions> - <execution> - <id>mdo</id> - <phase>generate-sources</phase> - <goals> - <goal>xpp3-reader</goal> - <goal>xpp3-writer</goal> - <goal>java</goal> - <goal>xsd</goal> - </goals> - <configuration> - <models> - <model>src/main/mdo/descriptor.mdo</model> - </models> - </configuration> - </execution> - <execution> - <id>mdo-site</id> - <phase>pre-site</phase> - <goals> - <goal>xdoc</goal> - <goal>xsd</goal> - </goals> - <configuration> - <models> - <model>src/main/mdo/descriptor.mdo</model> - </models> - </configuration> - </execution> - </executions> - </plugin> - - <!-- expose new plexus components --> - <plugin> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-component-metadata</artifactId> - <executions> - <execution> - <goals> - <goal>generate-metadata</goal> - </goals> - </execution> - </executions> - </plugin> + <build> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>helpmojo</goal> - </goals> - </execution> - </executions> - </plugin> + <plugins> - <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 licenProject.xsd</id> - <phase>pre-site</phase> - <configuration> - <tasks> - <copy verbose="${maven.verbose}" - failonerror="false" - overwrite="false" - file="target/generated-site/xsd/licenseProject-1.0.0.xsd" - tofile="target/site/licenseProject-1.0.0.xsd"/> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> + <!-- generate descriptor model + reader --> + <plugin> + <groupId>org.codehaus.modello</groupId> + <artifactId>modello-maven-plugin</artifactId> + <version>1.0</version> + <configuration> + <version>${mdoVersion}</version> + <lineLength>80</lineLength> + <useJava5>true</useJava5> + </configuration> + <executions> + <execution> + <id>mdo</id> + <phase>generate-sources</phase> + <goals> + <goal>xpp3-reader</goal> + <goal>xpp3-writer</goal> + <goal>java</goal> + <goal>xsd</goal> + </goals> + <configuration> + <models> + <model>src/main/mdo/descriptor.mdo</model> + </models> + </configuration> + </execution> + <execution> + <id>mdo-site</id> + <phase>pre-site</phase> + <goals> + <goal>xdoc</goal> + <goal>xsd</goal> + </goals> + <configuration> + <models> + <model>src/main/mdo/descriptor.mdo</model> + </models> + </configuration> + </execution> + </executions> + </plugin> - </plugins> + <!-- expose new plexus components --> + <plugin> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-metadata</artifactId> + <executions> + <execution> + <goals> + <goal>generate-metadata</goal> + </goals> + </execution> + </executions> + </plugin> - <pluginManagement> - <plugins> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>helpmojo</goal> + </goals> + </execution> + </executions> + </plugin> - <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> + <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 licenProject.xsd</id> + <phase>pre-site</phase> + <configuration> + <tasks> + <copy verbose="${maven.verbose}" + failonerror="false" + overwrite="false" + file="target/generated-site/xsd/licenseProject-1.0.0.xsd" + tofile="target/site/licenseProject-1.0.0.xsd"/> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> - </plugins> - </pluginManagement> + </plugins> - </build> + <pluginManagement> + <plugins> - <reporting> - <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> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - <version>2.5.1</version> - </plugin> + </plugins> + </pluginManagement> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.3</version> - </plugin> + </build> - </plugins> - </reporting> + <reporting> + <plugins> - <profiles> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <version>2.5.1</version> + </plugin> - <profile> - <id>run-its</id> - <build> - <defaultGoal>integration-test</defaultGoal> - <plugins> - <plugin> - <artifactId>maven-invoker-plugin</artifactId> - <configuration> - <pomIncludes> - <pomInclude>**/pom.xml</pomInclude> - </pomIncludes> - <postBuildHookScript>verify</postBuildHookScript> - <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> - <settingsFile>src/it/settings.xml</settingsFile> - <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> - <!--<debug>true</debug>--> - </configuration> - <executions> - <execution> - <id>integration-test</id> - <goals> - <goal>install</goal> - <goal>run</goal> - </goals> - <phase>integration-test</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.3</version> + </plugin> - </profiles> + </plugins> + </reporting> + <profiles> + + <profile> + <id>run-its</id> + <build> + <defaultGoal>integration-test</defaultGoal> + <plugins> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <pomIncludes> + <pomInclude>**/pom.xml</pomInclude> + </pomIncludes> + <postBuildHookScript>verify</postBuildHookScript> + <localRepositoryPath>${basedir}/target/local-repo + </localRepositoryPath> + <settingsFile>src/it/settings.xml</settingsFile> + <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> + <!--<debug>true</debug>--> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + <phase>integration-test</phase> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + + </profiles> + </project> Modified: trunk/src/main/java/org/nuiton/license/plugin/AddLicenseFileMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/AddLicenseFileMojo.java 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/java/org/nuiton/license/plugin/AddLicenseFileMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -126,7 +126,12 @@ @Override protected void init() throws Exception { + if (getLog().isDebugEnabled()) { + // always be verbose in debug mode + setVerbose(true); + } + // must generate if file does not exist doGenerate = true; Modified: trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/java/org/nuiton/license/plugin/AddThirdPartyFileMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -173,7 +173,12 @@ @Override protected void init() throws Exception { + if (getLog().isDebugEnabled()) { + // always be verbose in debug mode + setVerbose(true); + } + doGenerate = true; thirdPartyFile = new File(outputDirectory, thirdPartyFilename); Added: trunk/src/main/java/org/nuiton/license/plugin/CommentStyleListMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/CommentStyleListMojo.java (rev 0) +++ trunk/src/main/java/org/nuiton/license/plugin/CommentStyleListMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -0,0 +1,87 @@ +/* + * *##% + * Maven License Plugin + * 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>. + * ##%* + */ +package org.nuiton.license.plugin; + +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.nuiton.license.plugin.header.transformer.FileHeaderTransformer; + +import java.util.Map; +import java.util.Map.Entry; + +/** + * Displays all the available comment style to box file headers. + * + * @author themit <chemit@codelutin.com> + * @requiresProject false + * @requiresDirectInvocation + * @goal comment-style-list + * @since 2.1 + */ +public class CommentStyleListMojo extends AbstractLicenseMojo { + + /** + * Un drapeau pour afficher aussi le contenu des license. + * + * @parameter expression="${detail}" + * @since 2.1 + */ + protected boolean detail; + + /** + * All available header transformers. + * + * @component role="org.nuiton.license.plugin.header.transformer.FileHeaderTransformer" + * @since 2.1 + */ + protected Map<String, FileHeaderTransformer> transformers; + + @Override + protected void init() throws Exception { + //nothing to do + } + + @Override + public void doAction() throws MojoExecutionException, MojoFailureException { + + StringBuilder buffer = new StringBuilder("\n"); + buffer.append("\n\n-------------------------------------------------------------------------------\n"); + buffer.append(" maven-license-plugin\n"); + buffer.append("-------------------------------------------------------------------------------\n\n"); + + buffer.append("List of available comment style:\n\n"); + for (Entry<String, FileHeaderTransformer> e : transformers.entrySet()) { + FileHeaderTransformer generator = e.getValue(); + buffer.append(" - "); + buffer.append(e.getKey()); + buffer.append(" : "); + buffer.append(generator.getDescription()); + buffer.append("\n"); + if (detail) { + buffer.append("\n example : \n"); + buffer.append(generator.boxComment("header", true)); + buffer.append('\n'); + } + } + + getLog().info(buffer.toString()); + } +} \ No newline at end of file Property changes on: trunk/src/main/java/org/nuiton/license/plugin/CommentStyleListMojo.java ___________________________________________________________________ Added: svn:keywords + "Author Date Id Revision HeadURL Modified: trunk/src/main/java/org/nuiton/license/plugin/GeneratorListMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/GeneratorListMojo.java 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/java/org/nuiton/license/plugin/GeneratorListMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -35,7 +35,9 @@ * @requiresDirectInvocation * @goal generator-list * @since 1.0.1 + * @deprecated since 2.1, use now the {@code comment(style-list} goal. */ +@Deprecated public class GeneratorListMojo extends AbstractLicenseMojo { /** Modified: trunk/src/main/java/org/nuiton/license/plugin/LicenseListMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/LicenseListMojo.java 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/java/org/nuiton/license/plugin/LicenseListMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -59,6 +59,7 @@ @Override protected void init() throws Exception { + // obtain licenses store licenseStore = createLicenseStore(extraResolver); } Modified: trunk/src/main/java/org/nuiton/license/plugin/UpdateLicenseMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/license/plugin/UpdateLicenseMojo.java 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/java/org/nuiton/license/plugin/UpdateLicenseMojo.java 2010-04-09 18:35:55 UTC (rev 1725) @@ -148,6 +148,7 @@ /** descriptor of project */ protected LicenseProject licenseProject; + /** set of processed files */ protected Set<File> processedFiles; @Override @@ -171,8 +172,26 @@ return; } + if (isVerbose()) { + StringBuilder buffer = new StringBuilder(); + buffer.append("config - available comment styles :"); + String commentFormat = "\n * %1$s (%2$s)"; + for (Map.Entry<String, FileHeaderTransformer> e : + transformers.entrySet()) { + Map.Entry<String, FileHeaderTransformer> next = e; + FileHeaderTransformer transformer = next.getValue(); + String str = String.format(commentFormat, + transformer.getName(), + transformer.getDescription() + ); + buffer.append(str); + } + getLog().info(buffer.toString()); + } + if (updateCopyright) { + getLog().warn("updateCopyright is not still available..."); //TODO-TC20100409 checks scm // checks scm is ok // for the moment, will only deal with svn except if scm Modified: trunk/src/main/resources/log4j.properties =================================================================== --- trunk/src/main/resources/log4j.properties 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/main/resources/log4j.properties 2010-04-09 18:35:55 UTC (rev 1725) @@ -7,4 +7,4 @@ # package level -log4j.logger.org.nuiton=INFO +log4j.logger.org.nuiton=WARN Added: trunk/src/site/rst/header.rst =================================================================== --- trunk/src/site/rst/header.rst (rev 0) +++ trunk/src/site/rst/header.rst 2010-04-09 18:35:55 UTC (rev 1725) @@ -0,0 +1,126 @@ +License Header +~~~~~~~~~~~~~~ + + +:Author: Tony Chemit <chemit@codelutin.com> + +.. contents:: + :depth: 2 + +.. sectnum:: + :start: 1 + :depth: 2 + +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-license`_. + +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 type +====================== + +Here is the available comment types. + +Using the goal `comment-style-list`_ you can find all of them. + +java style +---------- + +/* + * HEADER + */ + +xml style +--------- + +<!-- + HEADER +--> + +properties style +---------------- + +###### +# HEADER +###### + +apt style +--------- + +~~~~~~ +~~ HEADER +~~~~~~ + +rst style +--------- + +TODO-TC20100409 Add rst implementation + +Ignore a header +=============== + +If you don't want `update-license` goal to treate a specific file, you can +use a specific tag in your class : + +:: + + %%License-Ignore + +You can change it with **ignoreTag** property. + +.. _update-license: update-license-mojo.html + +.. _comment-style-list: comment-style-list-mojo.html Modified: trunk/src/site/rst/index.rst =================================================================== --- trunk/src/site/rst/index.rst 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/site/rst/index.rst 2010-04-09 18:35:55 UTC (rev 1725) @@ -1,6 +1,15 @@ Introduction ------------ +:Author: Tony Chemit <chemit@codelutin.com> + +.. contents:: + :depth: 2 + +.. sectnum:: + :start: 1 + :depth: 2 + Maven license Plugin ==================== @@ -16,7 +25,7 @@ :: - %L Content L% + #%L Content #L% The header is composed of two parts : @@ -29,7 +38,7 @@ :: /* - * %L + * #%L * Plugin maven de changement de license * -- * Copyright (C) 2008 - 2009 CodeLutin @@ -47,7 +56,7 @@ * 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% + * #L% */ Goals Overview Modified: trunk/src/site/rst/usage.rst =================================================================== --- trunk/src/site/rst/usage.rst 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/site/rst/usage.rst 2010-04-09 18:35:55 UTC (rev 1725) @@ -1,6 +1,16 @@ Usage ----- +:Author: Tony Chemit <chemit@codelutin.com> + +.. contents:: + :depth: 2 + +.. sectnum:: + :start: 1 + :depth: 2 + + add-license goal ================ @@ -56,13 +66,28 @@ update-header goal ================== +**This goal is deprectaed since v 2.1** + +Prefer use now the **update-license** goal. + This goal adds or updates the license header on some files. for full detail see `update-header`_ detail page. +update-license 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-license`_ detail page. + How does it work ? ~~~~~~~~~~~~~~~~~~ +TODO-TC20100409 This is correct since 2.1 (redo a complete doc before 2.2) + The plugin is looking in the included files for the text between the tags : :: @@ -295,6 +320,8 @@ .. _update-header: update-header-mojo.html +.. _update-license: update-license-mojo.html + .. _generator-list: generator-list-mojo.html .. _license-list: license-list-mojo.html Modified: trunk/src/site/site_en.xml =================================================================== --- trunk/src/site/site_en.xml 2010-04-09 16:59:32 UTC (rev 1724) +++ trunk/src/site/site_en.xml 2010-04-09 18:35:55 UTC (rev 1725) @@ -21,47 +21,56 @@ --> <project name="${project.name}"> - <bannerLeft> - <name>${project.name}</name> - <href>index.html</href> - </bannerLeft> + <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> + <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> + <body> - <breadcrumbs> - <item name="${project.name}" href="index.html" /> - </breadcrumbs> + <breadcrumbs> + <item name="${project.name}" href="index.html"/> + </breadcrumbs> - <menu name="User"> - <item name="Introduction" href="index.html"/> - <item name="Usage" href="usage.html"/> - <item name="Goals" href="plugin-info.html"> - <item name="add-license" href="add-license-mojo.html"/> - <item name="add-third-party" href="add-third-party-mojo.html"/> - <item name="update-header" href="update-header-mojo.html"/> - <item name="generator-list" href="generator-list-mojo.html"/> - <item name="license-list" href="license-list-mojo.html"/> - <item name="help" href="help-mojo.html"/> - </item> - </menu> - - <menu name="Downloads"> - <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 name="User"> + <item name="Introduction" href="index.html"/> + <item name="File header model" href="header.html"/> + <item name="Usage" href="usage.html"/> + <item name="Goals" href="plugin-info.html"> + <item name="add-license" href="add-license-mojo.html"/> + <item name="add-third-party" href="add-third-party-mojo.html"/> + <item name="update-header" href="update-header-mojo.html"/> + <item name="generator-list" href="generator-list-mojo.html"/> + <item name="license-list" href="license-list-mojo.html"/> + <item name="help" href="help-mojo.html"/> + </item> + </menu> - <menu ref="reports"/> + <menu name="Downloads"> + <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> - </body> + <menu ref="reports"/> + + </body> </project>