Author: tchemit Date: 2010-04-06 21:28:25 +0200 (Tue, 06 Apr 2010) New Revision: 1712 Log: use modello to generate project license descriptor file Added: trunk/src/main/mdo/ trunk/src/main/mdo/descriptor.mdo trunk/src/main/resources/licenseProjects/ Modified: trunk/pom.xml trunk/src/main/resources/license/defaultHeader.vm Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-04-06 16:44:13 UTC (rev 1711) +++ trunk/pom.xml 2010-04-06 19:28:25 UTC (rev 1712) @@ -1,5 +1,7 @@ <?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"> +<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> @@ -12,7 +14,7 @@ <artifactId>mavenpom4redmine</artifactId> <version>2.0.7</version> </parent> - + <artifactId>maven-license-plugin</artifactId> <version>2.1-SNAPSHOT</version> @@ -248,7 +250,8 @@ <name>Maven License Plugin</name> <description> - Plugin pour mettre à jour l'en-tête des fichiers (avec la license choisie) + Plugin pour mettre à jour l'en-tête des fichiers (avec la license + choisie) dans un module maven 2. </description> <inceptionYear>2008</inceptionYear> @@ -274,9 +277,15 @@ <!-- 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> <!-- ************************************************************* --> @@ -289,6 +298,7 @@ <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> @@ -299,6 +309,48 @@ <plugins> + <!-- 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> @@ -331,10 +383,10 @@ <plugin> <artifactId>maven-site-plugin</artifactId> <!-- TODO Remove this when using mavenpom >=2.0.3 --> - <configuration> - <locales>${siteLocales}</locales> - <generateSitemap>true</generateSitemap> - </configuration> + <!--<configuration>--> + <!--<locales>${siteLocales}</locales>--> + <!--<generateSitemap>true</generateSitemap>--> + <!--</configuration>--> <dependencies> <dependency> <groupId>org.nuiton.jrst</groupId> @@ -362,7 +414,7 @@ <artifactId>maven-plugin-plugin</artifactId> <version>2.5.1</version> </plugin> - + <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> Added: trunk/src/main/mdo/descriptor.mdo =================================================================== --- trunk/src/main/mdo/descriptor.mdo (rev 0) +++ trunk/src/main/mdo/descriptor.mdo 2010-04-06 19:28:25 UTC (rev 1712) @@ -0,0 +1,183 @@ +<?xml version="1.0"?> + +<model xsd.namespace="http://maven-site.nuiton.org/maven-license-plugin/1.0.0" + xsd.targetNamespace="http://maven-site.nuiton.org/maven-license-plugin/1.0.0"> + + <id>licenseProject</id> + <name>LicenseProject</name> + <description> + <![CDATA[ + <p> + Maven License Plugin relies on the provided project descriptors to dictate + its execution. Although there are already prefabricated descriptors available + for use, they can only suffice some of the common assembly requirements. + </p> + <p> + So in order for you to customize the way the License Plugin creates your + assemblies, you need to know how to use the License project Descriptor. + </p> + <p> + This descriptor specifies the type of licenses to apply for some defined + filesets. + </p> + ]]> + </description> + <defaults> + <default> + <key>package</key> + <value>org.nuiton.license.plugin.model.project</value> + </default> + </defaults> + <classes> + <class rootElement="true" xml.tagName="project"> + <name>LicenseProject</name> + <description> + <![CDATA[ + An license project defines a collection of files to be reacted by the + plugin (says update header). + ]]> + </description> + <version>1.0.0+</version> + <fields> + <field> + <name>mainLicense</name> + <version>1.0.0+</version> + <required>true</required> + <type>String</type> + <description> + The main license of the project (or module). The LICENSE.txt will + contains the content of this license. + </description> + </field> + <field> + <name>licenseSets</name> + <version>1.0.0+</version> + <association> + <type>LicenseSet</type> + <multiplicity>*</multiplicity> + </association> + <description> + <![CDATA[ + Specifies licenses to apply on a project. A licenseSet is specified + by providing one or more of <licenseSet> subelements. + ]]> + </description> + </field> + </fields> + </class> + + <class> + <name>LicenseSet</name> + <description> + <![CDATA[ + A licenseSet represent one license to apply to one or more filesets. + ]]> + </description> + <version>1.0.0+</version> + <fields> + <field> + <name>licenseName</name> + <version>1.1.0+</version> + <type>String</type> + <required>true</required> + <description> + The license to apply in this set. + </description> + </field> + <field> + <name>fileSets</name> + <version>1.0.0+</version> + <association> + <type>FileSet</type> + <multiplicity>*</multiplicity> + </association> + <description> + <![CDATA[ + Specifies file sets to include in the license set. A fileSet is specified + by providing one or more of <licenseSet> subelements. + ]]> + </description> + </field> + </fields> + </class> + + <class> + <name>FileSet</name> + <version>1.0.0+</version> + <description> + A fileSet allows the inclusion of groups of files into the license set. + </description> + <fields> + <field> + <name>useDefaultExcludes</name> + <version>1.1.0+</version> + <type>boolean</type> + <defaultValue>true</defaultValue> + <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) + </description> + </field> + <field> + <name>basedir</name> + <version>1.0.0+</version> + <type>String</type> + <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. + </description> + </field> + <field> + <name>includes</name> + <version>1.0.0+</version> + <association> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + <description> + <![CDATA[ + When <include> subelements are present, they define a set of + files and directory to include. If none is present, then + <includes> represents all valid values. + ]]> + </description> + </field> + <field> + <name>excludes</name> + <version>1.0.0+</version> + <association> + <type>String</type> + <multiplicity>*</multiplicity> + </association> + <description> + <![CDATA[ + When <exclude> subelements are present, they define a set of + files and directory to exclude. If none is present, then + <excludes> represents no exclusions. + ]]> + </description> + </field> + <field> + <name>lineEnding</name> + <version>1.0.0+</version> + <type>String</type> + <description> + <![CDATA[ + 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> + ]]> + </description> + </field> + </fields> + </class> + </classes> +</model> Modified: trunk/src/main/resources/license/defaultHeader.vm =================================================================== --- trunk/src/main/resources/license/defaultHeader.vm 2010-04-06 16:44:13 UTC (rev 1711) +++ trunk/src/main/resources/license/defaultHeader.vm 2010-04-06 19:28:25 UTC (rev 1712) @@ -1,4 +1,5 @@ $projectName +-- Copyright (C) $inceptionYear $organizationName - +-- $licenseContent
participants (1)
-
tchemit@users.nuiton.org