Author: tchemit Date: 2010-04-12 12:59:27 +0200 (Mon, 12 Apr 2010) New Revision: 693 Log: - update changelog.txt - reformat code - use optimized license project descriptor - update doc Modified: trunk/changelog.txt trunk/pom.xml trunk/src/license/project.xml trunk/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java trunk/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java trunk/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java trunk/src/main/java/org/nuiton/io/FileUpdater.java trunk/src/main/java/org/nuiton/io/FileUpdaterHelper.java trunk/src/main/java/org/nuiton/io/MirroredFileUpdater.java trunk/src/main/java/org/nuiton/io/SortedProperties.java trunk/src/main/java/org/nuiton/io/mail/MailSender.java trunk/src/main/java/org/nuiton/io/mail/ProjectJavamailMailSender.java trunk/src/main/java/org/nuiton/io/rest/DefaultRestClientConfiguration.java trunk/src/main/java/org/nuiton/io/rest/RestClient.java trunk/src/main/java/org/nuiton/io/rest/RestClientConfiguration.java trunk/src/main/java/org/nuiton/io/rest/RestRequest.java trunk/src/main/java/org/nuiton/io/rest/RestRequestBuilder.java trunk/src/main/java/org/nuiton/io/rest/RestSession.java trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java trunk/src/main/java/org/nuiton/io/xpp3/DataConverter.java trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java trunk/src/main/java/org/nuiton/plugin/AbstractPlugin.java trunk/src/main/java/org/nuiton/plugin/DependencyUtil.java trunk/src/main/java/org/nuiton/plugin/Plugin.java trunk/src/main/java/org/nuiton/plugin/PluginHelper.java trunk/src/main/java/org/nuiton/plugin/PluginIOContext.java trunk/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java trunk/src/site/apt/mojo-examples.apt trunk/src/site/apt/mojo-testFramework.apt trunk/src/site/site_en.xml Modified: trunk/changelog.txt =================================================================== --- trunk/changelog.txt 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/changelog.txt 2010-04-12 10:59:27 UTC (rev 693) @@ -1,3 +1,36 @@ +maven-helper-plugin (1.2.3) stable; urgency=high + + * Evolution #480: Add cleanMojo hook in test + * Evolution #481: Improve io api + * Evolution #482: Use maven-license-plugin 2.1 + * Evolution #485: Use junit 4.8.1 + + -- chemit -- Mon, 12 Apr 2010 12:32:09 +0200 + +maven-helper-plugin (1.2.2) stable; urgency=high + + * Evolution #231: Ajout des fichiers de sites dans le goal collect-files (parametre includeSiteAttached) + + -- chemit -- 19/01/2010 + +maven-helper-plugin (1.2.1) stable; urgency=high + + * Evolution #204: Add usefull io api in PluginHelper + * Evolution #205: use mavenpom 1.1.4 + * Evolution #206: Open ShareServerSecretPlugin api to make it reusable from outside + + -- chemit -- 14/01/2010 + +maven-helper-plugin (1.2.0) stable; urgency=high + + * Evolution #128: Ajout d'un goal pour générer une page index.html dans les site respectant la symetricLayout + * Evolution #181: Permettre de n'éxecuter qu'une seule fois le goal share-server-secret + * Evolution #182: Api d'AbstractPlugin revisité + * Evolution #183: Enrichissement de l'api d'io dans PluginHelper en AbstractPlugin + * Evolution #186: Utilisation de mavenpom + + -- chemit -- 06/01/2010 + maven-helper-plugin (1.1.0) stable; urgency=high * [FIX #60] rendre le plugin compatible maven 2.2.x Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/pom.xml 2010-04-12 10:59:27 UTC (rev 693) @@ -1,460 +1,478 @@ <?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> + <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-helper-plugin</artifactId> + <artifactId>maven-helper-plugin</artifactId> - <version>1.2.3-SNAPSHOT</version> + <version>1.2.3-SNAPSHOT</version> - <dependencies> + <dependencies> - <!-- compile dependencies --> + <!-- compile dependencies --> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> - <version>1.1.1</version> - </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <version>1.1.1</version> + </dependency> - <!-- fix dependency pb in xpp3Reader (need at least version > 2.2) --> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - <version>2.4</version> - </dependency> + <!-- fix dependency pb in xpp3Reader (need at least version > 2.2) --> + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + <version>2.4</version> + </dependency> - <dependency> - <groupId>commons-httpclient</groupId> - <artifactId>commons-httpclient</artifactId> - <version>3.1</version> - </dependency> + <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + <version>3.1</version> + </dependency> - <dependency> - <groupId>commons-collections</groupId> - <artifactId>commons-collections</artifactId> - <version>3.2.1</version> - </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <version>3.2.1</version> + </dependency> - <dependency> - <groupId>org.apache.maven.shared</groupId> - <artifactId>maven-dependency-tree</artifactId> - <version>1.2</version> - </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-dependency-tree</artifactId> + <version>1.2</version> + </dependency> - <dependency> - <groupId>org.apache.velocity</groupId> - <artifactId>velocity</artifactId> - <version>1.6.3</version> - </dependency> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + <version>1.6.3</version> + </dependency> - <!-- plexus --> + <!-- plexus --> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-utils</artifactId> - <version>1.5.15</version> - </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <version>1.5.15</version> + </dependency> - <dependency> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-sec-dispatcher</artifactId> - <version>1.3.1</version> - </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-sec-dispatcher</artifactId> + <version>1.3.1</version> + </dependency> - <dependency> - <groupId>org.sonatype.plexus</groupId> - <artifactId>plexus-cipher</artifactId> - <version>1.5</version> - </dependency> + <dependency> + <groupId>org.sonatype.plexus</groupId> + <artifactId>plexus-cipher</artifactId> + <version>1.5</version> + </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-container-default</artifactId> - <version>1.0-alpha-9-stable-1</version> - <scope>provided</scope> - </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <version>1.0-alpha-9-stable-1</version> + <scope>provided</scope> + </dependency> - <dependency> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-api</artifactId> - <version>${plexusMailSender.version}</version> - <exclusions> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-container-default</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-api</artifactId> + <version>${plexusMailSender.version}</version> + <exclusions> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-container-default</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-javamail</artifactId> - <version>${plexusMailSender.version}</version> - <exclusions> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-container-default</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-javamail</artifactId> + <version>${plexusMailSender.version}</version> + <exclusions> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-container-default</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> - <groupId>plexus</groupId> - <artifactId>plexus-mail-sender-simple</artifactId> - <version>${plexusMailSender.version}</version> - <exclusions> - <exclusion> - <groupId>plexus</groupId> - <artifactId>plexus-container-default</artifactId> - </exclusion> - </exclusions> - </dependency> + <dependency> + <groupId>plexus</groupId> + <artifactId>plexus-mail-sender-simple</artifactId> + <version>${plexusMailSender.version}</version> + <exclusions> + <exclusion> + <groupId>plexus</groupId> + <artifactId>plexus-container-default</artifactId> + </exclusion> + </exclusions> + </dependency> - <!-- provided dependencies --> + <!-- provided dependencies --> - <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-model</artifactId> - <version>${maven.version}</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-settings</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-model</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.apache.maven</groupId> + <artifactId>maven-settings</artifactId> + <version>${maven.version}</version> + <scope>provided</scope> + </dependency> - <dependency> - <groupId>org.apache.maven</groupId> - <artifactId>maven-artifact</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-artifact</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> - <!-- forces use of javamail 1.4 since it's the only version available in the repo. We should remove this as soon - as the dependency in plexus-mail-sender-javamail will be updated - --> - <dependency> - <groupId>javax.mail</groupId> - <artifactId>mail</artifactId> - <version>1.4</version> - <!--TODO test this --> - <!--<version>1.4.2</version>--> - </dependency> + <!-- forces use of javamail 1.4 since it's the only version available in + the repo. We should remove this as soon as the dependency in + plexus-mail-sender-javamail will be updated + --> + <dependency> + <groupId>javax.mail</groupId> + <artifactId>mail</artifactId> + <version>1.4</version> + <!--TODO test this --> + <!--<version>1.4.2</version>--> + </dependency> - <!-- tests dependencies --> + <!-- tests dependencies --> - <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.codehaus.plexus</groupId> - <artifactId>plexus-archiver</artifactId> - </exclusion> + <exclusion> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-archiver</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-http-lightweight</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-http-lightweight</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-file</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-file</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-ssh</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-ssh</artifactId> + </exclusion> - <exclusion> - <groupId>org.apache.maven.reporting</groupId> - <artifactId>maven-reporting-api</artifactId> - </exclusion> + <exclusion> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-api</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.8.1</version> + <scope>test</scope> + </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.14</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.codehaus.plexus</groupId> - <artifactId>plexus-velocity</artifactId> - <version>1.1.8</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> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-velocity</artifactId> + <version>1.1.8</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> - </dependencies> + </dependencies> - <!-- ************************************************************* --> - <!-- *** Project Information ************************************* --> - <!-- ************************************************************* --> - <name>Maven helper plugin</name> - <description>Plugin d'aide pour les projets nuiton</description> - <inceptionYear>2009</inceptionYear> - <url>http://maven-site.nuiton.org/maven-helper-plugin</url> + <!-- ************************************************************* --> + <!-- *** Project Information ************************************* --> + <!-- ************************************************************* --> + <name>Maven helper plugin</name> + <description>Plugin d'aide pour les projets nuiton</description> + <inceptionYear>2009</inceptionYear> + <url>http://maven-site.nuiton.org/maven-helper-plugin</url> - <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> + <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 ************************************** --> + <!-- ************************************************************* --> - <scm> - <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</connection> - <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</developerConnection> - <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/trunk</url> - </scm> + <scm> + <connection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</connection> + <developerConnection>scm:svn:http://svn.nuiton.org/svn/maven-helper-plugin/trunk</developerConnection> + <url>http://www.nuiton.org/repositories/browse/maven-helper-plugin/trunk</url> + </scm> - <!-- ************************************************************* --> - <!-- *** Build Settings ****************************************** --> - <!-- ************************************************************* --> + <!-- ************************************************************* --> + <!-- *** Build Settings ****************************************** --> + <!-- ************************************************************* --> - <packaging>maven-plugin</packaging> + <packaging>maven-plugin</packaging> - <properties> + <properties> - <plexusMailSender.version>1.0-alpha-2</plexusMailSender.version> + <plexusMailSender.version>1.0-alpha-2</plexusMailSender.version> - <!-- extra files to include in release --> - <redmine.releaseFiles>${redmine.libReleaseFiles}</redmine.releaseFiles> + <!-- extra files to include in release --> + <redmine.releaseFiles>${redmine.libReleaseFiles}</redmine.releaseFiles> - <!-- documention is in english --> - <siteLocales>en</siteLocales> + <!-- documention is in english --> + <siteLocales>en</siteLocales> - <!-- documentation is in apt --> - <siteSourcesType>apt</siteSourcesType> - </properties> + <!-- documentation is in apt --> + <siteSourcesType>apt</siteSourcesType> - <build> + </properties> - <testResources> - <testResource> - <directory>${maven.src.dir}/test/resources</directory> - <includes> - <include>**/*</include> - </includes> - <excludes> - <exclude>**/*~</exclude> - </excludes> - </testResource> - </testResources> + <build> - <plugins> + <testResources> + <testResource> + <directory>${maven.src.dir}/test/resources</directory> + <includes> + <include>**/*</include> + </includes> + <excludes> + <exclude>**/*~</exclude> + </excludes> + </testResource> + </testResources> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>helpmojo</goal> - </goals> - </execution> - </executions> - </plugin> + <plugins> - <plugin> - <artifactId>maven-jar-plugin</artifactId> - <executions> - <execution> - <id>attach-test</id> - <goals> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> + <plugin> + <artifactId>maven-jar-plugin</artifactId> + <executions> + <execution> + <id>attach-test</id> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> - </build> + </build> - <reporting> + <profiles> + <!-- perform only on a release stage when using the maven-release-plugin --> + <profile> + <id>reporting</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + + + <reporting> <plugins> - <plugin> - <artifactId>maven-plugin-plugin</artifactId> - <version>2.5.1</version> - </plugin> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <version>2.5.1</version> + </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>cobertura-maven-plugin</artifactId> - <version>2.3</version> - </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>cobertura-maven-plugin</artifactId> + <version>2.3</version> + </plugin> </plugins> - </reporting> + </reporting> + </profile> - <profiles> - <!-- perform only on a release stage when using the maven-release-plugin --> - <profile> - <id>release-profile</id> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> + <!-- perform only on a release stage when using the maven-release-plugin --> + <profile> + <id>release-profile</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> - <build> - <plugins> + <build> + <plugins> - <!-- always compute source jar --> - <plugin> - <artifactId>maven-source-plugin</artifactId> - <executions> - <execution> - <id>attach-sources</id> - <goals> - <goal>jar</goal> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> + <!-- always compute source jar --> + <plugin> + <artifactId>maven-source-plugin</artifactId> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar</goal> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> - <!-- always compute javadoc jar --> - <plugin> - <artifactId>maven-javadoc-plugin</artifactId> - <executions> - <execution> - <id>attach-javadocs</id> - <goals> - <goal>jar</goal> - <goal>test-jar</goal> - </goals> - </execution> - </executions> - </plugin> + <!-- always compute javadoc jar --> + <plugin> + <artifactId>maven-javadoc-plugin</artifactId> + <executions> + <execution> + <id>attach-javadocs</id> + <goals> + <goal>jar</goal> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + </plugin> - <!-- build release zip files --> - <plugin> - <artifactId>maven-assembly-plugin</artifactId> - <executions> - <execution> - <id>create-assemblies</id> - <phase>package</phase> - <goals> - <goal>single</goal> - </goals> - </execution> - </executions> - <configuration> - <attach>false</attach> - <descriptorRefs> - <descriptorRef>deps</descriptorRef> - <descriptorRef>full</descriptorRef> - </descriptorRefs> - </configuration> - </plugin> + <!-- build release zip files --> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <executions> + <execution> + <id>create-assemblies</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + <configuration> + <attach>false</attach> + <descriptorRefs> + <descriptorRef>deps</descriptorRef> + <descriptorRef>full</descriptorRef> + </descriptorRefs> + </configuration> + </plugin> - </plugins> - </build> - </profile> + <plugin> + <artifactId>maven-plugin-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>helpmojo</goal> + </goals> + </execution> + </executions> + </plugin> - <profile> - <id>run-its</id> - <activation> - <property> - <name>performRelease</name> - <value>true</value> - </property> - </activation> - <build> - <plugins> - <plugin> - <artifactId>maven-invoker-plugin</artifactId> - <configuration> - <pomIncludes> - <pomInclude>collect-files/single/pom.xml</pomInclude> - <pomInclude>collect-files/multi/pom.xml</pomInclude> - <pomInclude>send-email/single/pom.xml</pomInclude> - <pomInclude>share-server-secret/single/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> - </configuration> - <executions> - <execution> - <id>integration-test</id> - <goals> - <goal>install</goal> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> + </plugins> + </build> + + </profile> - </profiles> + <profile> + <id>run-its</id> + <activation> + <property> + <name>performRelease</name> + <value>true</value> + </property> + </activation> + <build> + <plugins> + <plugin> + <artifactId>maven-invoker-plugin</artifactId> + <configuration> + <pomIncludes> + <pomInclude>**/pom.xml</pomInclude> + <!--<pomInclude>collect-files/single/pom.xml</pomInclude>--> + <!--<pomInclude>collect-files/multi/pom.xml</pomInclude>--> + <!--<pomInclude>send-email/single/pom.xml</pomInclude>--> + <!--<pomInclude>share-server-secret/single/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> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>install</goal> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + </project> Modified: trunk/src/license/project.xml =================================================================== --- trunk/src/license/project.xml 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/license/project.xml 2010-04-12 10:59:27 UTC (rev 693) @@ -1,44 +1,39 @@ <?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"> + xsi:schemaLocation="http://maven-site.nuiton.org/maven-license-plugin/1.0.0 http://maven-site.nuiton.org/maven-license-plugin/licenseProjectDescriptor-1.0.0.xsd"> <mainLicense>lgpl_v3</mainLicense> - <licenseSets> - <licenseSet> + <headers> + + <header> + <commentStyle>java</commentStyle> <fileSets> - <fileSet> - <headerType>java</headerType> + <fileSet> <basedir>src/main/java</basedir> - <includes> - <include>**/*.java</include> - </includes> + <include>**/*.java</include> </fileSet> - - <fileSet> - <headerType>java</headerType> + <fileSet> <basedir>src/test/java</basedir> - <includes> - <include>**/*.java</include> - </includes> + <include>**/*.java</include> </fileSet> + </fileSets> + </header> - <fileSet> - <headerType>apt</headerType> - <basedir>src/site</basedir> - <includes> - <include>**/*.apt</include> - </includes> - </fileSet> + <header> + <commentStyle>apt</commentStyle> + <fileSet> + <basedir>src/site</basedir> + <include>**/*.apt</include> + </fileSet> + </header> - <fileSet> - <headerType>xml</headerType> - <basedir>src/site</basedir> - <includes> - <include>**/*.xml</include> - </includes> - </fileSet> + <header> + <commentStyle>xml</commentStyle> + <fileSet> + <basedir>src/site</basedir> + <include>**/*.xml</include> + </fileSet> + </header> - </fileSets> - </licenseSet> - </licenseSets> + </headers> </project> Modified: trunk/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/helper/plugin/CollectFilesMojo.java 2010-04-12 10:59:27 UTC (rev 693) @@ -36,7 +36,8 @@ import org.nuiton.plugin.AbstractPlugin; import org.nuiton.plugin.PluginHelper; -import java.io.*; +import java.io.File; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -61,6 +62,7 @@ * @since 1.0.3 */ protected MavenProject project; + /** * The artifacts to publish from the project build. * @@ -70,6 +72,7 @@ * @since 1.0.0 */ protected List attachedArtifacts; + /** * The local repository. * @@ -79,6 +82,7 @@ * @since 1.2.2 */ protected ArtifactRepository localRepository; + /** * The remote repository. * @@ -88,6 +92,7 @@ * @since 1.2.2 */ protected ArtifactRepository deploymentRepository; + /** * Project artifact. * @@ -97,6 +102,7 @@ * @since 1.2.2 */ protected Artifact artifact; + /** * User extra files to collect. * <p/> @@ -106,6 +112,7 @@ * @since 1.0.0 */ protected String extraFiles; + /** * File name pattern of selected files to publish. * <p/> @@ -115,6 +122,7 @@ * @since 1.0.0 */ protected String includes; + /** * File name pattern of selected files to publish. * <p/> @@ -124,6 +132,7 @@ * @since 1.0.0 */ protected String excludes; + /** * Directory where to store collected files. * <p/> @@ -135,6 +144,7 @@ * @since 1.0.0 */ protected String outputDirectory; + /** * File with all files collected (one file by line in absolute path). * <p/> @@ -144,6 +154,7 @@ * @since 1.0.0 */ protected String descriptionFile; + /** * Un flag pour collecter aussi les fichiers attaches au projet. * @@ -151,6 +162,7 @@ * @since 1.0.0 */ protected boolean includeAttached; + /** * Un flag pour collecter aussi les fichiers des sites attaches au projet. * @@ -166,6 +178,7 @@ * @since 1.0.0 */ protected boolean copyFiles; + /** * Un flag pour activer le mode verbeux. * @@ -173,6 +186,7 @@ * @since 1.0.0 */ protected boolean verbose; + /** * A flag to skip the goal. * @@ -180,6 +194,7 @@ * @since 1.0.0 */ protected boolean skip; + /** * Un flag pour activer le mode verbeux. * @@ -187,6 +202,7 @@ * @since 1.0.0 */ protected boolean dryRun; + /** * Encoding a utiliser pour lire et ecrire les fichiers. * @@ -195,9 +211,8 @@ * @since 1.0.0 */ protected String encoding; - /** - * Files to collect - */ + + /** Files to collect */ protected List<File> files; @Override @@ -208,7 +223,7 @@ files = getFiles(); } - + @Override protected boolean checkSkip() { if (skip) { @@ -232,7 +247,8 @@ File base = new File(rootProject.getBasedir(), outputDirectory); - File output = new File(base, project.getGroupId() + "--" + project.getArtifactId()); + File output = new File(base, project.getGroupId() + "--" + + project.getArtifactId()); if (rootProject == project || verbose) { getLog().info("Ouput dir : " + output); @@ -265,7 +281,8 @@ incomingFiles = getFiles(description); getLog().info("Loaded " + description); } catch (IOException ex) { - throw new MojoExecutionException("could not load file " + description, ex); + throw new MojoExecutionException( + "could not load file " + description, ex); } } else { incomingFiles = new ArrayList<File>(); @@ -273,7 +290,9 @@ } if (!withDescriptionFile && !copyFiles) { - throw new MojoExecutionException("must use at least one of the parameters 'copyFiles' or 'descriptionFile'"); + throw new MojoExecutionException( + "must use at least one of the parameters 'copyFiles' or " + + "'descriptionFile'"); } String basedir = rootProject.getBasedir().getAbsolutePath(); @@ -308,7 +327,8 @@ getLog().info("Saved " + description); } } catch (IOException ex) { - throw new MojoExecutionException("could not save file " + description, ex); + throw new MojoExecutionException( + "could not save file " + description, ex); } } } @@ -345,8 +365,12 @@ protected List<File> getFiles() { - Pattern includePattern = includes == null || includes.trim().isEmpty() ? null : Pattern.compile(includes.trim()); - Pattern excludePattern = excludes == null || excludes.trim().isEmpty() ? null : Pattern.compile(excludes.trim()); + Pattern includePattern = includes == null || + includes.trim().isEmpty() ? null : + Pattern.compile(includes.trim()); + Pattern excludePattern = excludes == null || + excludes.trim().isEmpty() ? null : + Pattern.compile(excludes.trim()); List<File> result = new ArrayList<File>(); @@ -355,10 +379,20 @@ if (includeAttached) { if ("pom".equals(project.getPackaging())) { - addFile(project.getFile(), "adding artifact file : ", result, includePattern, excludePattern); + addFile(project.getFile(), + "adding artifact file : ", + result, + includePattern, + excludePattern + ); } else { - addFile(artifact.getFile(), "adding artifact file : ", result, includePattern, excludePattern); + addFile(artifact.getFile(), + "adding artifact file : ", + result, + includePattern, + excludePattern + ); } } File file; @@ -376,7 +410,12 @@ file = new File(basedir, path.trim()); } - addFile(file, "adding user file : ", result, includePattern, excludePattern); + addFile(file, + "adding user file : ", + result, + includePattern, + excludePattern + ); } } @@ -391,7 +430,12 @@ for (Object o : attachedArtifacts) { file = ((Artifact) o).getFile(); - addFile(file, "adding attached artifact file : ", result, includePattern, excludePattern); + addFile(file, + "adding attached artifact file : ", + result, + includePattern, + excludePattern + ); } } @@ -400,13 +444,25 @@ getLog().info("Will add site attached files."); } for (ArtifactMetadata o : artifact.getMetadataList()) { - //TC-20100118 : we do not want to include maven-site-plugin as dependencies - //This is a big hack and we should sheck this name does not changes when bumping - // maven version (anyway, it is not risky since this class should never change ?) - if ("SiteDescriptorArtifactMetadata".equals(o.getClass().getSimpleName())) { - File destination = new File(localRepository.getBasedir(), - localRepository.pathOfLocalRepositoryMetadata(o, deploymentRepository)); - addFile(destination, "adding site descriptor file : ", result, includePattern, excludePattern); + //TC-20100118 : we do not want to include maven-site-plugin + // as dependencies + //This is a big hack and we should sheck this name does not + // changes when bumping maven version (anyway, it is not risky + // since this class should never change ?) + if ("SiteDescriptorArtifactMetadata".equals( + o.getClass().getSimpleName())) { + String path = + localRepository.pathOfLocalRepositoryMetadata( + o, deploymentRepository); + File destination = new File( + localRepository.getBasedir(), + path); + addFile(destination, + "adding site descriptor file : ", + result, + includePattern, + excludePattern + ); } } } @@ -425,7 +481,11 @@ return root; } - protected void addFile(File f, String msg, List<File> files, Pattern includePattern, Pattern excludePattern) { + protected void addFile(File f, + String msg, + List<File> files, + Pattern includePattern, + Pattern excludePattern) { if (f == null) { return; } @@ -446,7 +506,8 @@ if (!includePattern.matcher(f.getName()).matches()) { // skip this file if (verbose) { - getLog().info("skip " + f + " : not in includes " + includes); + getLog().info( + "skip " + f + " : not in includes " + includes); } return; } Modified: trunk/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java =================================================================== --- trunk/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/helper/plugin/SendEmailMojo.java 2010-04-12 10:59:27 UTC (rev 693) @@ -64,6 +64,7 @@ * @since 1.0.3 */ protected MavenProject project; + /** * Un flag pour activer le mode verbeux. * @@ -71,6 +72,7 @@ * @since 1.0.3 */ protected boolean verbose; + /** * The Velocity template used to format the email announcement. * @@ -79,6 +81,7 @@ * @since 1.0.3 */ protected File emailContentFile; + /** * The title of the email to send. * @@ -87,6 +90,7 @@ * @since 1.0.3 */ protected String emailTitle; + /** * Smtp Server. * @@ -95,6 +99,7 @@ * @since 1.0.3 */ protected String smtpHost; + /** * Port. * @@ -103,6 +108,7 @@ * @since 1.0.3 */ protected int smtpPort; + /** * The username used to send the email. * @@ -110,6 +116,7 @@ * @since 1.0.3 */ protected String username; + /** * The password used to send the email. * @@ -117,6 +124,7 @@ * @since 1.0.3 */ protected String password; + /** * If the email should be sent in SSL mode. * @@ -124,24 +132,28 @@ * @since 1.0.3 */ protected boolean sslMode; + /** - * The id of the developer sending the announcement mail. Only used if the <tt>mailSender</tt> - * attribute is not set. In this case, this should match the id of one of the developers in - * the pom. If a matching developer is not found, then the first developer in the pom will be + * The id of the developer sending the announcement mail. Only used if + * the <tt>mailSender</tt> attribute is not set. In this case, this should + * match the id of one of the developers in the pom. If a matching + * developer is not found, then the first developer in the pom will be * used. * * @parameter expression="${helper.fromDeveloperId}" * @since 1.0.3 */ protected String fromDeveloperId; + /** - * Defines the sender of the announcement if the list of developer is empty or - * if the sender is not a member of the development team. + * Defines the sender of the announcement if the list of developer is empty + * or if the sender is not a member of the development team. * * @parameter expression="${helper.mailSender}" * @since 1.0.3 */ protected MailSender mailSender; + /** * Recipient email address. * @@ -150,6 +162,7 @@ * @since 1.0.3 */ protected List<String> toAddresses; + /** * Possible senders. * @@ -159,6 +172,7 @@ * @since 1.0.3 */ protected List<Developer> from; + /** * Mail content type to use. * @@ -167,6 +181,7 @@ * @since 1.0.3 */ protected String mailContentType; + /** * The encoding used to read and write files. * @@ -174,6 +189,7 @@ * @since 1.0.3 */ protected String encoding; + /** * A flag to skip the goal. * @@ -181,6 +197,7 @@ * @since 1.0.3 */ protected boolean skipSendEmail; + /** * A flag to test plugin but send nothing to redmine. * @@ -188,6 +205,7 @@ * @since 1.0.3 */ protected boolean dryRun; + /** * A flag to restirct only one run in a build (for multi-module context). * @@ -195,8 +213,10 @@ * @since 1.0.3 */ protected boolean runOnce; + /** - * internal flag to know if plugin was already executed (for multi-module projects) + * internal flag to know if plugin was already executed + * (for multi-module projects) */ private boolean runOnceDone; /////////////////////////////////////////////////////////////////////////// @@ -226,6 +246,7 @@ /////////////////////////////////////////////////////////////////////////// /// AbstractPlugin /////////////////////////////////////////////////////////////////////////// + @Override protected void init() throws Exception { @@ -245,7 +266,8 @@ if (!emailContentFile.exists()) { // no file to publish... - throw new MojoExecutionException("could not find the template " + emailContentFile); + throw new MojoExecutionException( + "could not find the template " + emailContentFile); } // check mail sender @@ -253,28 +275,37 @@ if (mailSender == null) { if (from == null || from.isEmpty()) { - throw new MojoExecutionException("The <developers> section in your pom should not be empty. Add a <developer> entry or set the " + "mailSender parameter."); + throw new MojoExecutionException( + "The <developers> section in your pom should " + + "not be empty. Add a <developer> entry or set " + + "the " + "mailSender parameter."); } if (fromDeveloperId == null) { - final Developer dev = from.get(0); + Developer dev = from.get(0); mailSender = new MailSender(dev.getName(), dev.getEmail()); } else { for (Developer developer : from) { if (fromDeveloperId.equals(developer.getId())) { - mailSender = new MailSender(developer.getName(), developer.getEmail()); + mailSender = new MailSender(developer.getName(), + developer.getEmail() + ); break; } } if (mailSender == null) { - throw new MojoExecutionException("Missing developer with id '" + fromDeveloperId + "' in the <developers> section in your pom."); + throw new MojoExecutionException( + "Missing developer with id '" + fromDeveloperId + + "' in the <developers> section in your pom."); } } } String fromAddress = mailSender.getEmail(); if (StringUtils.isEmpty(fromAddress)) { - throw new MojoExecutionException("Invalid mail sender: name and email is mandatory (" + mailSender + ")."); + throw new MojoExecutionException( + "Invalid mail sender: name and email is mandatory (" + + mailSender + ")."); } } @@ -289,7 +320,8 @@ if (runOnce && runOnceDone) { // already run - getLog().info("runOnce flag is on and goal was laready executed, will skip the goal"); + getLog().info("runOnce flag is on and goal was already " + + "executed, will skip the goal"); return false; } @@ -304,7 +336,8 @@ getLog().info("\n dryRun flag is on, no mail will be send!\n"); } - String newsContent = PluginHelper.readAsString(emailContentFile, encoding); + String newsContent = + PluginHelper.readAsString(emailContentFile, encoding); MailMessage mailMsg = createMessage(newsContent, mailSender); @@ -327,23 +360,28 @@ mailer.send(mailMsg); getLog().info("Sent..."); } catch (MailSenderException e) { - throw new MojoExecutionException("Failed to send email for reason " + e.getMessage(), e); + throw new MojoExecutionException( + "Failed to send email for reason " + e.getMessage(), e); } } /////////////////////////////////////////////////////////////////////////// /// Other /////////////////////////////////////////////////////////////////////////// + protected boolean isGoalSkip() { return skipSendEmail; } - protected MailMessage createMessage(String newsContent, MailSender mailSender) throws MailSenderException { + protected MailMessage createMessage( + String newsContent, + MailSender mailSender) throws MailSenderException { String fromName = mailSender.getName(); String fromAddress = mailSender.getEmail(); - getLog().info("Using this sender for email announcement: " + fromAddress + " < " + fromName + " > "); + getLog().info("Using this sender for email announcement: " + + fromAddress + " < " + fromName + " > "); MailMessage mailMsg = new MailMessage(); mailMsg.setSubject(emailTitle); @@ -381,8 +419,8 @@ return mailer; } - public void setMailSender(MailSender sender) { - this.mailSender = sender; + public void setMailSender(MailSender mailSender) { + this.mailSender = mailSender; } public void setFrom(List<Developer> from) { @@ -393,6 +431,7 @@ this.toAddresses = toAddresses; } + @Override protected boolean isExecutionRoot() { return project.isExecutionRoot(); } Modified: trunk/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/helper/plugin/ShareServerSecretPlugin.java 2010-04-12 10:59:27 UTC (rev 693) @@ -62,7 +62,7 @@ public class ShareServerSecretPlugin extends AbstractPlugin { /** - * Dependance du projet. + * Project. * * @parameter default-value="${project}" * @required @@ -71,7 +71,7 @@ */ protected MavenProject project; /** - * Dependance du settings. + * Settings. * * @parameter default-value="${settings}" * @required @@ -103,7 +103,8 @@ * <p/> * <b>Note:</b> If not set - then no export of the password of the server. * <p/> - * <b>Note:</b> If the password is crypted (since maven 2.1.0) then decrypt it. + * <b>Note:</b> If the password is crypted (since maven 2.1.0) then + * decrypt it. * * @parameter * @since 1.1.0 @@ -114,7 +115,8 @@ * <p/> * <b>Note:</b> If not set - then no export of the passphrase of the server. * <p/> - * <b>Note:</b> If the passphrase is crypted (since maven 2.1.0) then decrypt it. + * <b>Note:</b> If the passphrase is crypted (since maven 2.1.0) then + * decrypt it. * * @parameter * @since 1.1.0 @@ -130,17 +132,17 @@ */ protected String privateKeyOut; /** - * Un flag pour activer le mode verbeux. + * A flag to activate verbose mode. * * @parameter expression="${helper.verbose}" default-value="${maven.verbose}" * @since 1.1.0 */ protected boolean verbose; /** - * Un flag pour ne lancer le plugin qu'une seule fois par build. + * A flag to execute only once the mojo. * <p/> - * <b>Note:</b> Par défaut, la valeur est à {@code true} car il ne parrâit pas - * nécessaire de rejouer le mojo à chaque fois. + * <b>Note:</b> By default, value is {@code true} since it is not necessary + * to inject twice secrets in session. * * @parameter expression="${helper.runOnce}" default-value="true" * @since 1.1.0 @@ -209,7 +211,10 @@ propertiesToTreate.put(Property.privateKey, privateKeyOut); } if (propertiesToTreate.isEmpty()) { - throw new MojoExecutionException("Nothing to export, you should specify what to export via 'usernameOut', 'passwordOut', 'passphraseOut' or 'privateKeyOut' parameters."); + throw new MojoExecutionException( + "Nothing to export, you should specify what to " + + "export via 'usernameOut', 'passwordOut', " + + "'passphraseOut' or 'privateKeyOut' parameters."); } if (StringUtils.isEmpty(serverId)) { @@ -219,7 +224,9 @@ server = settings.getServer(serverId.trim()); if (server == null) { - throw new MojoExecutionException("Could not find server with id '" + serverId + "', check your settings.xml file."); + throw new MojoExecutionException( + "Could not find server with id '" + serverId + + "', check your settings.xml file."); } } @@ -232,7 +239,8 @@ StringBuilder buffer = new StringBuilder("share-secret##"); buffer.append(serverId); buffer.append("##"); - for (Map.Entry<Property, String> entry : propertiesToTreate.entrySet()) { + for (Map.Entry<Property, String> entry : + propertiesToTreate.entrySet()) { buffer.append(entry.getKey()).append(entry.getValue()); } // check if plugin was already done. @@ -251,7 +259,8 @@ long timestamp = System.nanoTime(); project.getProperties().put(key, timestamp + ""); if (verbose) { - getLog().info("Adding cache key " + key + " with timestamp " + timestamp); + getLog().info("Adding cache key " + key + + " with timestamp " + timestamp); } } @@ -263,7 +272,8 @@ Properties properties = project.getModel().getProperties(); - for (Map.Entry<Property, String> entry : this.propertiesToTreate.entrySet()) { + for (Map.Entry<Property, String> entry : + propertiesToTreate.entrySet()) { Property key = entry.getKey(); String propertyValue = key.getSecret(server); String propertyTargetName = entry.getValue(); @@ -273,7 +283,8 @@ } propertyValue = sec.decrypt(propertyValue); - getLog().info("export server [" + serverId + "] " + key.name() + " in ${" + propertyTargetName + "}"); + getLog().info("export server [" + serverId + "] " + key.name() + + " in ${" + propertyTargetName + "}"); properties.setProperty(propertyTargetName, propertyValue); } } Modified: trunk/src/main/java/org/nuiton/io/FileUpdater.java =================================================================== --- trunk/src/main/java/org/nuiton/io/FileUpdater.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/FileUpdater.java 2010-04-12 10:59:27 UTC (rev 693) @@ -33,7 +33,7 @@ /** * Contract to be realized to test if a file is up to date. * <p/> - * use {@link #isFileUpToDate(java.io.File)} to determine if a file is up to date. + * use {@link #isFileUpToDate(File)} to determine if a file is up to date. * * @author tchemit <chemit@codelutin.com> */ @@ -41,7 +41,7 @@ /** * @param f file to test - * @return <code>true</code> if file is up to date, <code>false</code> otherwise + * @return {@code true} if file is up to date, {@code false} otherwise. */ boolean isFileUpToDate(File f); Modified: trunk/src/main/java/org/nuiton/io/FileUpdaterHelper.java =================================================================== --- trunk/src/main/java/org/nuiton/io/FileUpdaterHelper.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/FileUpdaterHelper.java 2010-04-12 10:59:27 UTC (rev 693) @@ -56,34 +56,43 @@ */ public static class JavaFileUpdater extends MirroredFileUpdater { - protected JavaFileUpdater(File sourceDirectory, File destinationDirectory) { + protected JavaFileUpdater(File sourceDirectory, + File destinationDirectory) { super(".java", ".class", sourceDirectory, destinationDirectory); } @Override public File getMirrorFile(File f) { - String file = f.getAbsolutePath().substring(prefixSourceDirecotory); - String mirrorRelativePath = file.substring(0, file.length() - 4) + "class"; - return new File(destinationDirectory + File.separator + mirrorRelativePath); + String file = + f.getAbsolutePath().substring(prefixSourceDirecotory); + String mirrorRelativePath = + file.substring(0, file.length() - 4) + "class"; + return new File(destinationDirectory + File.separator + + mirrorRelativePath); } } /** - * To test if a jaxx source file is newser than his generated java source file + * To test if a jaxx source file is newser than his generated java + * source file. * * @author tchemit <chemit@codelutin.com> */ public static class JaxxFileUpdater extends MirroredFileUpdater { - protected JaxxFileUpdater(File sourceDirectory, File destinationDirectory) { + protected JaxxFileUpdater(File sourceDirectory, + File destinationDirectory) { super(".jaxx", ".java", sourceDirectory, destinationDirectory); } @Override public File getMirrorFile(File f) { - String file = f.getAbsolutePath().substring(prefixSourceDirecotory); - String mirrorRelativePath = file.substring(0, file.length() - 4) + "java"; - return new File(destinationDirectory + File.separator + mirrorRelativePath); + String file = + f.getAbsolutePath().substring(prefixSourceDirecotory); + String mirrorRelativePath = + file.substring(0, file.length() - 4) + "java"; + return new File(destinationDirectory + File.separator + + mirrorRelativePath); } } } Modified: trunk/src/main/java/org/nuiton/io/MirroredFileUpdater.java =================================================================== --- trunk/src/main/java/org/nuiton/io/MirroredFileUpdater.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/MirroredFileUpdater.java 2010-04-12 10:59:27 UTC (rev 693) @@ -34,7 +34,8 @@ import java.io.File; /** - * Simple base implementation of a {@link FileUpdater} for an updater with a sourcedir and a destinationdir. + * Simple base implementation of a {@link FileUpdater} for an updater with + * a sourcedir and a destinationdir. * * @author tchemit <chemit@codelutin.com> */ @@ -42,22 +43,30 @@ /** to use log facility, just put in your code: log.info(\"...\"); */ static private final Log log = LogFactory.getLog(MirroredFileUpdater.class); + /** source basedir */ protected File sourceDirectory; + /** length of source basedir absolute path */ protected int prefixSourceDirecotory; + /** destination basedir */ protected File destinationDirectory; + protected String fileInPattern = ""; + protected String fileOutPattern = ""; - public MirroredFileUpdater(String fileInPattern, String fileOutPattern, File sourceDirectory, File destinationDirectory) { + public MirroredFileUpdater(String fileInPattern, + String fileOutPattern, + File sourceDirectory, + File destinationDirectory) { this.fileInPattern = fileInPattern; this.fileOutPattern = fileOutPattern; this.sourceDirectory = sourceDirectory; this.destinationDirectory = destinationDirectory; if (sourceDirectory != null) { - this.prefixSourceDirecotory = sourceDirectory.getAbsolutePath().length(); + prefixSourceDirecotory = sourceDirectory.getAbsolutePath().length(); } if (log.isDebugEnabled()) { log.debug(this); @@ -86,7 +95,8 @@ file = file.substring(0, file.length() - filename.length()); String destFilename = applyTransformationFilename(filename); String mirrorRelativePath = file + destFilename; - return new File(destinationDirectory + File.separator + mirrorRelativePath); + return new File(destinationDirectory + File.separator + + mirrorRelativePath); } @Override @@ -101,7 +111,7 @@ public void setSourceDirectory(File sourceDirectory) { this.sourceDirectory = sourceDirectory; - this.prefixSourceDirecotory = sourceDirectory.getAbsolutePath().length(); + prefixSourceDirecotory = sourceDirectory.getAbsolutePath().length(); } public void setFileInPattern(String fileInPattern) { @@ -118,6 +128,7 @@ @Override public String toString() { - return super.toString() + "<srcdir:" + sourceDirectory + ", destdir:" + destinationDirectory + ">"; + return super.toString() + "<srcdir:" + sourceDirectory + + ", destdir:" + destinationDirectory + ">"; } } Modified: trunk/src/main/java/org/nuiton/io/SortedProperties.java =================================================================== --- trunk/src/main/java/org/nuiton/io/SortedProperties.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/SortedProperties.java 2010-04-12 10:59:27 UTC (rev 693) @@ -61,7 +61,6 @@ } public SortedProperties(String encoding, boolean removeHeader) { - super(); this.encoding = encoding; this.removeHeader = removeHeader; } Modified: trunk/src/main/java/org/nuiton/io/mail/MailSender.java =================================================================== --- trunk/src/main/java/org/nuiton/io/mail/MailSender.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/mail/MailSender.java 2010-04-12 10:59:27 UTC (rev 693) @@ -43,7 +43,6 @@ private String email; public MailSender() { - super(); } public MailSender(String name, String email) { Modified: trunk/src/main/java/org/nuiton/io/mail/ProjectJavamailMailSender.java =================================================================== --- trunk/src/main/java/org/nuiton/io/mail/ProjectJavamailMailSender.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/mail/ProjectJavamailMailSender.java 2010-04-12 10:59:27 UTC (rev 693) @@ -42,6 +42,7 @@ import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; +import com.sun.net.ssl.internal.ssl.Provider; import org.codehaus.plexus.mailsender.AbstractMailSender; import org.codehaus.plexus.mailsender.MailMessage; import org.codehaus.plexus.mailsender.MailSenderException; @@ -92,7 +93,7 @@ props.put("mail.debug", String.valueOf(getLogger().isDebugEnabled())); if (isSslMode()) { - Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); + Security.addProvider(new Provider()); props.put("mail.smtp.socketFactory.port", String.valueOf(getSmtpPort())); Modified: trunk/src/main/java/org/nuiton/io/rest/DefaultRestClientConfiguration.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/DefaultRestClientConfiguration.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/DefaultRestClientConfiguration.java 2010-04-12 10:59:27 UTC (rev 693) @@ -42,10 +42,15 @@ public class DefaultRestClientConfiguration implements RestClientConfiguration { URL restUrl; + String restUsername; + String restPassword; + boolean verbose; + boolean anonymous; + String encoding; @Override @@ -108,7 +113,9 @@ @Override public String toString() { - ToStringBuilder b = new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE); + ToStringBuilder b = new ToStringBuilder(this, + ToStringStyle.MULTI_LINE_STYLE + ); b.append("redmineUrl", restUrl); if (anonymous) { Modified: trunk/src/main/java/org/nuiton/io/rest/RestClient.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/RestClient.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/RestClient.java 2010-04-12 10:59:27 UTC (rev 693) @@ -28,14 +28,14 @@ package org.nuiton.io.rest; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import java.io.IOException; import java.io.InputStream; import java.util.Map; import java.util.TreeMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - /** * Abtract REST client. * @@ -45,17 +45,14 @@ public abstract class RestClient { private static final Log log = LogFactory.getLog(RestClient.class); - /** - * rest client configuration - */ + + /** rest client configuration */ protected RestClientConfiguration configuration; - /** - * rest session - */ + + /** rest session */ protected RestSession session; - /** - * registred requests - */ + + /** registred requests */ protected final Map<String, RestRequestBuilder> requestBuilders; /** @@ -88,7 +85,7 @@ protected abstract void close(RestSession session) throws IOException; public RestClient() { - this.requestBuilders = new TreeMap<String, RestRequestBuilder>(); + requestBuilders = new TreeMap<String, RestRequestBuilder>(); addDefaultRequests(); } @@ -143,7 +140,9 @@ InputStream in = session.askData(request); return in; } catch (IOException e) { - throw new RestException("could not ask data to server to reason " + e.getMessage(), e); + throw new RestException( + "could not ask data to server to reason " + + e.getMessage(), e); } } @@ -163,7 +162,9 @@ InputStream in = session.sendData(request); return in; } catch (IOException e) { - throw new RestException("could not send data to server for reason " + e.getMessage(), e); + throw new RestException( + "could not send data to server for reason " + + e.getMessage(), e); } } @@ -171,7 +172,7 @@ * Open the client. * <p/> * <b>Note:</b> this method will instanciate the {@link #session} and invoke - * the method {@link #open(org.nuiton.io.rest.RestSession)}. + * the method {@link #open(RestSession)}. * * @throws RestException if any pb while opening session */ @@ -200,7 +201,9 @@ session = null; } } - throw new RestException("could not open rest client for reason " + e.getMessage(), e); + throw new RestException( + "could not open rest client for reason " + + e.getMessage(), e); } } @@ -208,7 +211,7 @@ * Close the client. * <p/> * <b>Note:</b> this method will erase the {@link #session} and invoke - * the method {@link #close(org.nuiton.io.rest.RestSession)}. + * the method {@link #close(RestSession)}. * * @throws RestException if any pb while closing session */ @@ -220,7 +223,9 @@ try { close(session); } catch (Exception e) { - throw new RestException("could not close client for reason " + e.getMessage(), e); + throw new RestException( + "could not close client for reason " + + e.getMessage(), e); } finally { session = null; } @@ -236,16 +241,12 @@ return session != null; } - /** - * @return the internal rest {@link #session} - */ + /** @return the internal rest {@link #session} */ public RestSession getSession() { return session; } - /** - * @return the internal {@link #configuration} - */ + /** @return the internal {@link #configuration} */ public RestClientConfiguration getConfiguration() { return configuration; } Modified: trunk/src/main/java/org/nuiton/io/rest/RestClientConfiguration.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/RestClientConfiguration.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/RestClientConfiguration.java 2010-04-12 10:59:27 UTC (rev 693) @@ -37,65 +37,40 @@ * @since 1.0.3 */ public interface RestClientConfiguration { - /** - * @return base url of server - */ + + /** @return base url of server */ URL getRestUrl(); - /** - * @return the encoding used to encode request to send - */ + /** @return the encoding used to encode request to send */ String getEncoding(); - /** - * @return the username to connect to server - */ + /** @return the username to connect to server */ String getRestUsername(); - /** - * @return the password to connect to server - */ + /** @return the password to connect to server */ String getRestPassword(); - /** - * @return {@code true} to make verbose client (show request and parameters) - */ + /** @return {@code true} to make verbose client (show request and parameters) */ boolean isVerbose(); - /** - * - * @return {@code true} if rest client does not need login - */ + /** @return {@code true} if rest client does not need login */ boolean isAnonymous(); - /** - * @param restUrl the url of server to set - */ + /** @param restUrl the url of server to set */ void setRestUrl(URL restUrl); - /** - * @param restPassword the password to connect to server to set - */ + /** @param restPassword the password to connect to server to set */ void setRestPassword(String restPassword); - /** - * @param restUsername the username to connect to server to set - */ + /** @param restUsername the username to connect to server to set */ void setRestUsername(String restUsername); - /** - * @param encoding the encodng used to encode request to set - */ + /** @param encoding the encodng used to encode request to set */ void setEncoding(String encoding); - /** - * @param verbose the flag verbose to set - */ + /** @param verbose the flag verbose to set */ void setVerbose(boolean verbose); - /** - * - * @param anonymous the flag anonymous to set - */ + /** @param anonymous the flag anonymous to set */ void setAnonymous(boolean anonymous); } Modified: trunk/src/main/java/org/nuiton/io/rest/RestRequest.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/RestRequest.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/RestRequest.java 2010-04-12 10:59:27 UTC (rev 693) @@ -38,18 +38,15 @@ * @since 1.0.3 */ public interface RestRequest { - /** - * @return the splitted path to add to url - */ + /** @return the splitted path to add to url */ String[] getPath(); /** - * @return an array of pair (parameter name - parameter value) to pass to request + * @return an array of pair (parameter name - parameter value) to pass + * to request */ String[] getParameters(); - /** - * @return the map of attachment to pass to request - */ + /** @return the map of attachment to pass to request */ Map<String, File> getAttachments(); } Modified: trunk/src/main/java/org/nuiton/io/rest/RestRequestBuilder.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/RestRequestBuilder.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/RestRequestBuilder.java 2010-04-12 10:59:27 UTC (rev 693) @@ -35,9 +35,8 @@ * @since 1.0.3 */ public interface RestRequestBuilder { - /** - * @return the unique name of the request builder - */ + + /** @return the unique name of the request builder */ String getName(); /** Modified: trunk/src/main/java/org/nuiton/io/rest/RestSession.java =================================================================== --- trunk/src/main/java/org/nuiton/io/rest/RestSession.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/rest/RestSession.java 2010-04-12 10:59:27 UTC (rev 693) @@ -28,23 +28,7 @@ package org.nuiton.io.rest; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; - -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import org.apache.commons.httpclient.Cookie; -import org.apache.commons.httpclient.HostConfiguration; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpConnection; -import org.apache.commons.httpclient.HttpMethod; -import org.apache.commons.httpclient.HttpState; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.StatusLine; +import org.apache.commons.httpclient.*; import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.multipart.FilePart; import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity; @@ -54,6 +38,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + /** * A REST session. * @@ -70,21 +63,25 @@ // } protected HttpClient client; + protected static final Log log = LogFactory.getLog(RestSession.class); + protected boolean open; + protected boolean showRequest; + protected RestClientConfiguration configuration; RestSession(RestClientConfiguration configuration) { - this.showRequest = configuration.isVerbose(); + showRequest = configuration.isVerbose(); this.configuration = configuration; - this.client = new HttpClient(); + client = new HttpClient(); HostConfiguration hostConfiguration = new HostConfiguration(); hostConfiguration.setHost(configuration.getRestUrl().getHost()); // set encoding (will then encode parameters fine) - this.client.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, configuration.getEncoding()); - this.client.setHostConfiguration(hostConfiguration); - this.client.setState(new HttpState()); + client.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET, configuration.getEncoding()); + client.setHostConfiguration(hostConfiguration); + client.setState(new HttpState()); } public InputStream askData(RestRequest request) throws RestException, IOException { @@ -104,19 +101,24 @@ } if (statusCode == HttpStatus.SC_NOT_FOUND) { - throw new RestDataNotFoundException("could not retreave some datas : " + gm.getResponseBodyAsString()); + throw new RestDataNotFoundException( + "could not retreave some datas : " + + gm.getResponseBodyAsString()); } if (statusCode != HttpStatus.SC_OK) { - log.error("Error = "+gm.getResponseBodyAsString()); + log.error("Error = " + gm.getResponseBodyAsString()); releaseConnection(getConnection()); - throw new RestException("Got error code <" + statusCode + ":" + sl.getReasonPhrase() + "> on " + gm.getPath()); + throw new RestException( + "Got error code <" + statusCode + ":" + + sl.getReasonPhrase() + "> on " + gm.getPath()); } InputStream stream = gm.getResponseBodyAsStream(); return stream; } - public InputStream sendData(RestRequest request) throws RestException, IOException { + public InputStream sendData(RestRequest request) throws RestException, + IOException { if (!open) { throw new IllegalStateException("the session is not opened"); @@ -134,7 +136,9 @@ if (statusCode != HttpStatus.SC_OK) { log.error(gm.getResponseBodyAsString()); releaseConnection(getConnection()); - throw new RestException("Got error code <" + statusCode + ":" + sl.getReasonPhrase() + "> on " + gm.getPath()); + throw new RestException( + "Got error code <" + statusCode + ":" + + sl.getReasonPhrase() + "> on " + gm.getPath()); } InputStream stream = gm.getResponseBodyAsStream(); @@ -148,7 +152,7 @@ public void close() throws IOException { client.getState().clearCookies(); releaseConnection(getConnection()); - this.open = false; + open = false; } protected void releaseConnection(HttpConnection connection) { @@ -158,7 +162,9 @@ } protected HttpConnection getConnection() { - return client.getHttpConnectionManager().getConnection(client.getHostConfiguration()); + return client.getHttpConnectionManager().getConnection( + client.getHostConfiguration() + ); } protected String getUri(String... paths) { @@ -179,14 +185,16 @@ log.info("doRequest " + uri); } if (log.isDebugEnabled()) { - log.debug("doRequest with parameters : " + Arrays.toString(parameters)); + log.debug("doRequest with parameters : " + + Arrays.toString(parameters)); } PostMethod gm = new PostMethod(uri); if (open) { Cookie[] cookies = client.getState().getCookies(); for (Cookie c : cookies) { if (log.isDebugEnabled()) { - log.debug("push cookie : " + c.getName() + "=" + c.getValue()); + log.debug("push cookie : " + + c.getName() + "=" + c.getValue()); } gm.addRequestHeader("Cookie", c.toExternalForm()); } @@ -247,7 +255,13 @@ if (log.isDebugEnabled()) { log.debug("add attachment " + key + "=" + file); } - paramParts.add(new FilePart(key, file.getName(), file, FilePart.DEFAULT_CONTENT_TYPE, configuration.getEncoding())); + paramParts.add(new FilePart( + key, + file.getName(), + file, + FilePart.DEFAULT_CONTENT_TYPE, + configuration.getEncoding()) + ); } if (attachments.isEmpty()) { log.warn("no attachment in a multi-part request!"); @@ -255,16 +269,19 @@ Part[] parts = paramParts.toArray(new Part[paramParts.size()]); - MultipartRequestEntity entity = new MultipartRequestEntity(parts, gm.getParams()); + MultipartRequestEntity entity = + new MultipartRequestEntity(parts, gm.getParams()); if (log.isDebugEnabled()) { entity.writeRequest(System.out); } gm.setRequestEntity(entity); // gm.addRequestHeader("content-type", "multipart/form-data"); gm.addRequestHeader("content-type", entity.getContentType()); - gm.addRequestHeader("content-length", entity.getContentLength() + ""); + gm.addRequestHeader("content-length", entity.getContentLength() + + ""); if (showRequest) { - log.info("content-type : " + entity.getContentType() + ", content-length : " + entity.getContentLength()); + log.info("content-type : " + entity.getContentType() + + ", content-length : " + entity.getContentLength()); } } Modified: trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java =================================================================== --- trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/xpp3/AbstractXpp3Reader.java 2010-04-12 10:59:27 UTC (rev 693) @@ -49,8 +49,8 @@ * The logic of setting properties from xml (tag and attributes) is done in * <p/> * <ul> - * <li>{@link #read(String, Class, org.codehaus.plexus.util.xml.pull.XmlPullParser, boolean)} </li> - * <li>{@link #readArray(String, String, Class, org.codehaus.plexus.util.xml.pull.XmlPullParser, boolean)}</li> + * <li>{@link #read(String, Class, XmlPullParser, boolean)} </li> + * <li>{@link #readArray(String, String, Class, XmlPullParser, boolean)}</li> * </ul> * <p/> * The default implementation is to map tag text to a pojo's property. @@ -76,18 +76,16 @@ * </ul> */ protected boolean addDefaultEntities = true; - /** - * the type of the object to produce from the xml streams. - */ + + /** the type of the object to produce from the xml streams. */ protected final Class<O> type; - /** - * the root tag of an object to retreave from xml streams. - */ + + /** the root tag of an object to retreave from xml streams. */ protected String rootTagName; - /** - * the root tag of an array of objets to retreave from xml streams. - */ + + /** the root tag of an array of objets to retreave from xml streams. */ protected String arrayRootTagName; + /** * the univers of mappers availables, initialized in {@link #initMappers()}. * <p/> @@ -108,15 +106,19 @@ this(type, null, rootTagName); } - protected AbstractXpp3Reader(Class<O> type, String arrayRootTagName, String rootTagName) { + protected AbstractXpp3Reader(Class<O> type, + String arrayRootTagName, + String rootTagName) { this.type = type; this.rootTagName = rootTagName; this.arrayRootTagName = arrayRootTagName; - this.allMappers = new TreeMap<String, PropertyMapper>(); + allMappers = new TreeMap<String, PropertyMapper>(); try { initMappers(); } catch (IntrospectionException e) { - throw new IllegalStateException("could not init " + this + " for reason " + e.getMessage(), e); + throw new IllegalStateException( + "could not init " + this + " for reason " + + e.getMessage(), e); } } @@ -142,7 +144,7 @@ @Override public void setParentRootTagName(String parentRootTagName) { - this.arrayRootTagName = parentRootTagName; + arrayRootTagName = parentRootTagName; } @Override @@ -161,7 +163,8 @@ } @Override - public O read(Reader reader, boolean strict) throws IOException, XmlPullParserException { + public O read(Reader reader, + boolean strict) throws IOException, XmlPullParserException { XmlPullParser parser = new MXParser(); parser.setInput(reader); @@ -173,7 +176,8 @@ parser.next(); - // read the first open tag getRootTagName() and consume the matching ending tag + // read the first open tag getRootTagName() and consume the matching + // ending tag O result = read(getRootTagName(), getType(), parser, strict); // go after the ending tag getRootTagName() @@ -186,12 +190,14 @@ } @Override - public O[] readArray(Reader reader) throws IOException, XmlPullParserException { + public O[] readArray(Reader reader) + throws IOException, XmlPullParserException { return readArray(reader, true); } @Override - public O[] readArray(Reader reader, boolean strict) throws IOException, XmlPullParserException { + public O[] readArray(Reader reader, boolean strict) + throws IOException, XmlPullParserException { XmlPullParser parser = new MXParser(); parser.setInput(reader); @@ -205,7 +211,12 @@ parser.getEventType(); - O[] result = readArray(getArrayRootTagName(), getRootTagName(), getType(), parser, strict); + O[] result = readArray(getArrayRootTagName(), + getRootTagName(), + getType(), + parser, + strict + ); parser.next(); @@ -229,9 +240,10 @@ * @return the dictionnary of mappers for the given type. */ public Map<String, PropertyMapper> getMappers(Class<?> srcType) { - Map<String, PropertyMapper> result = new TreeMap<String, PropertyMapper>(); + Map<String, PropertyMapper> result = + new TreeMap<String, PropertyMapper>(); String prefix = srcType.getName() + "#"; - for (Entry<String, PropertyMapper> e : this.allMappers.entrySet()) { + for (Entry<String, PropertyMapper> e : allMappers.entrySet()) { if (e.getKey().startsWith(prefix)) { result.put(e.getValue().getTagName(), e.getValue()); } @@ -240,9 +252,11 @@ } /** - * Parse the xml stream from the given parser and a build the associated object. + * Parse the xml stream from the given parser and a build the associated + * object. * <p/> - * This default implementation just match a tag text content to a pojo property. + * This default implementation just match a tag text content to a pojo + * property. * <p/> * No work is done on attribute values here. * <p/> @@ -262,12 +276,17 @@ * @param rootTagName the name of the root tag matching the object to build * @param type the type of object to build * @param parser the xpp3 parser - * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned + * @param strict flag to indicate if should fail if a unknown tag + * (or attribute ?) is scanned * @return the single object build from the xml stream. * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - protected <T> T read(String rootTagName, Class<T> type, XmlPullParser parser, boolean strict) throws XmlPullParserException, IOException { + protected <T> T read(String rootTagName, + Class<T> type, + XmlPullParser parser, + boolean strict) + throws XmlPullParserException, IOException { // search open tag rootTagName gotoNextOpenTag(rootTagName, parser); @@ -278,13 +297,15 @@ result = type.newInstance(); } catch (Exception ex) { // should never happens! - throw new RuntimeException("could not instanciate a new " + getType().getName() + " for reason : " + ex.getMessage(), ex); + throw new RuntimeException( + "could not instanciate a new " + getType().getName() + + " for reason : " + ex.getMessage(), ex); } // prepare alvailable mappers for the given type Map<String, PropertyMapper> mappers = getMappers(type); - Set<String> parsed = parsed = new java.util.HashSet<String>(); + Set<String> parsed = new HashSet<String>(); try { // go to next tag int eventType = parser.next(); @@ -299,7 +320,9 @@ if (mapper != null) { mapper.setProperty(result, parser, parsed, strict); } else if (strict) { - throw new XmlPullParserException("Unrecognised tag: '" + parser.getName() + "'", parser, null); + throw new XmlPullParserException( + "Unrecognised tag: '" + parser.getName() + + "'", parser, null); } } else if (eventType == XmlPullParser.END_TAG) { if (parser.getName().equals(rootTagName)) { @@ -321,9 +344,11 @@ } /** - * Parse the xml stream from the given parser and a build an array of associated object. + * Parse the xml stream from the given parser and a build an array of + * associated object. * <p/> - * This default implementation just match a tag text content to a pojo property. + * This default implementation just match a tag text content to a pojo + * property. * <p/> * No work is done on attribute values here. * <p/> @@ -348,12 +373,18 @@ * @param rootTagName the tag's name of each object to build * @param type the type of objects to build * @param parser the xpp3 parser - * @param strict flag to indicate if should fail if a unknown tag (or attribute ?) is scanned + * @param strict flag to indicate if should fail if a unknown + * tag (or attribute ?) is scanned * @return the single object build from the xml stream. * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - protected <T> T[] readArray(String parentRootTagName, String rootTagName, Class<T> type, XmlPullParser parser, boolean strict) throws XmlPullParserException, IOException { + protected <T> T[] readArray(String parentRootTagName, + String rootTagName, + Class<T> type, + XmlPullParser parser, + boolean strict) + throws XmlPullParserException, IOException { // search open tag parentRootTagName // if not found, will raise an parsing exception @@ -370,7 +401,8 @@ addChild = false; quit = false; - // search next opening tag (rootTagName) or ending tag (parentRootTagName) + // search next opening tag (rootTagName) or ending tag + // (parentRootTagName) while (true) { @@ -380,13 +412,15 @@ int eventType = parser.next(); - if (eventType == XmlPullParser.START_TAG && rootTagName.equals(parser.getName())) { + if (eventType == XmlPullParser.START_TAG && + rootTagName.equals(parser.getName())) { // there is a child to read addChild = true; break; } - if (eventType == XmlPullParser.END_TAG && parentRootTagName.equals(parser.getName())) { + if (eventType == XmlPullParser.END_TAG && + parentRootTagName.equals(parser.getName())) { // can quit main loop, end of work quit = true; break; @@ -408,7 +442,9 @@ // no more child // must be at the end of tag if (!quit) { - throw new XmlPullParserException("should be on " + parentRootTagName + " but was not : " + parser.getName()); + throw new XmlPullParserException( + "should be on " + parentRootTagName + + " but was not : " + parser.getName()); } } @@ -416,12 +452,14 @@ return results.toArray((T[]) Array.newInstance(type, results.size())); } - protected int gotoNextOpenTag(String tagName, XmlPullParser parser) throws XmlPullParserException, IOException { + protected int gotoNextOpenTag(String tagName, XmlPullParser parser) + throws XmlPullParserException, IOException { // search next open tag tagName int eventType = parser.getEventType(); - while (eventType != XmlPullParser.START_TAG || !parser.getName().equals(tagName)) { + while (eventType != XmlPullParser.START_TAG || + !parser.getName().equals(tagName)) { checkNotEndOfXml(parser, tagName); @@ -436,12 +474,17 @@ * * @param parser the parser to check * @param tagName the endign tag's name - * @throws XmlPullParserException if the parser is at the end of the xml stream, instead of the {@code tagName} ending tag + * @throws XmlPullParserException if the parser is at the end of the xml + * stream, instead of the {@code tagName} + * ending tag */ - protected void checkNotEndOfXml(XmlPullParser parser, String tagName) throws XmlPullParserException { + protected void checkNotEndOfXml(XmlPullParser parser, String tagName) + throws XmlPullParserException { if (parser.getEventType() == XmlPullParser.END_DOCUMENT) { // can not be here ? - throw new XmlPullParserException("end of document found... but required at least the ending tag " + tagName); + throw new XmlPullParserException( + "end of document found... but required at least the " + + "ending tag " + tagName); } } @@ -449,12 +492,16 @@ * Checks that a given parser is at the end of the xml document. * * @param parser the parser to check - * @throws XmlPullParserException if the parser is not at the end of the xml stream. + * @throws XmlPullParserException if the parser is not at the end of the + * xml stream. */ - protected void checkEndOfXml(XmlPullParser parser) throws XmlPullParserException { + protected void checkEndOfXml(XmlPullParser parser) + throws XmlPullParserException { // must be at the end of the document if (parser.getEventType() != XmlPullParser.END_DOCUMENT) { - throw new XmlPullParserException("should be at the end of document but was not... : " + parser.getName()); + throw new XmlPullParserException( + "should be at the end of document but was not... : " + + parser.getName()); } } } Modified: trunk/src/main/java/org/nuiton/io/xpp3/DataConverter.java =================================================================== --- trunk/src/main/java/org/nuiton/io/xpp3/DataConverter.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/xpp3/DataConverter.java 2010-04-12 10:59:27 UTC (rev 693) @@ -30,10 +30,10 @@ /** * A contract to a data converter from a text value to a typed value. - * + * <p/> * We does not here use the commons-beans classes, since we could have different * types of converter for a same type.... - * + * * @author tchemit <chemit@codelutin.com> * @since 1.0.3 */ Modified: trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java =================================================================== --- trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/xpp3/PropertyMapper.java 2010-04-12 10:59:27 UTC (rev 693) @@ -35,6 +35,7 @@ import java.beans.PropertyDescriptor; import java.io.IOException; import java.text.ParseException; +import java.util.Map; import java.util.Set; /** @@ -43,15 +44,17 @@ * Two implementations are given : * <p/> * <ul> - * <li>{@link TagTextContentToProperty} to map the text content of a tag to a pojo's property</li> - * <li>{@link AttributeValueToProperty} to map the text content of a tag to a pojo's property</li> + * <li>{@link TagTextContentToProperty} to map the text content of a tag + * to a pojo's property</li> + * <li>{@link AttributeValueToProperty} to map the text content of a tag + * to a pojo's property</li> * </ul> * <p/> * There is two convinient factory methods in {@link Xpp3Helper} to add some new mappers into a given * dictionnary of mappers. * <ul> - * <li> {@link Xpp3Helper#addTagTextContentMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String...)}</li> - * <li>{@link Xpp3Helper#addAttributeValueMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String...)}</li> + * <li> {@link Xpp3Helper#addTagTextContentMappers(Class, DataConverter, boolean, Map, String...)}</li> + * <li>{@link Xpp3Helper#addAttributeValueMappers(Class, DataConverter, boolean, Map, String...)}</li> * </ul> * * @author tchemit <chemit@codelutin.com> @@ -61,12 +64,24 @@ public static class TagTextContentToProperty extends PropertyMapper { - public TagTextContentToProperty(String tagName, String propertyName, Class<?> containerType, DataConverter type, boolean onlyOne, PropertyDescriptor descriptor) { - super(tagName, propertyName, containerType, type, onlyOne, descriptor); + public TagTextContentToProperty(String tagName, + String propertyName, + Class<?> containerType, + DataConverter type, + boolean onlyOne, + PropertyDescriptor descriptor) { + super(tagName, + propertyName, + containerType, + type, + onlyOne, + descriptor + ); } @Override - protected Object getDataFromXml(XmlPullParser parser) throws Exception { + protected Object getDataFromXml(XmlPullParser parser) + throws Exception { String t = parser.nextText(); Object result = null; if (t != null && !(t = t.trim()).isEmpty()) { @@ -78,12 +93,24 @@ public static class AttributeValueToProperty extends PropertyMapper { - public AttributeValueToProperty(String tagName, String propertyName, Class<?> containerType, DataConverter type, boolean onlyOne, PropertyDescriptor descriptor) { - super(tagName, propertyName, containerType, type, onlyOne, descriptor); + public AttributeValueToProperty(String tagName, + String propertyName, + Class<?> containerType, + DataConverter type, + boolean onlyOne, + PropertyDescriptor descriptor) { + super(tagName, + propertyName, + containerType, + type, + onlyOne, + descriptor + ); } @Override - protected Object getDataFromXml(XmlPullParser parser) throws Exception { + protected Object getDataFromXml(XmlPullParser parser) + throws Exception { String t = parser.getAttributeValue("", name); Object result = null; if (t != null && !(t = t.trim()).isEmpty()) { @@ -93,34 +120,34 @@ } } - /** - * name of tag (or attribute to deal with) - */ + /** name of tag (or attribute to deal with) */ protected final String name; - /** - * the pojo's property to set - */ + + /** the pojo's property to set */ protected final String propertyName; - /** - * the converter from xml to pojo's property type - */ + + /** the converter from xml to pojo's property type */ protected final DataConverter type; - /** - * the type of the pojo container of the property - */ + + /** the type of the pojo container of the property */ protected final Class<?> containerType; - /** - * the pojo's property descriptor - */ + + /** the pojo's property descriptor */ protected final PropertyDescriptor descriptor; + /** * a flag to check to use only once the mapper. (should not be used for * attributes implementations). */ protected final boolean onlyOne; - protected PropertyMapper(String tagName, String propertyName, Class<?> containerType, DataConverter type, boolean onlyOne, PropertyDescriptor descriptor) { - this.name = tagName; + protected PropertyMapper(String tagName, + String propertyName, + Class<?> containerType, + DataConverter type, + boolean onlyOne, + PropertyDescriptor descriptor) { + name = tagName; this.propertyName = propertyName; this.type = type; this.onlyOne = onlyOne; @@ -128,11 +155,19 @@ this.descriptor = descriptor; } - protected abstract Object getDataFromXml(XmlPullParser parser) throws Exception; + protected abstract Object getDataFromXml(XmlPullParser parser) + throws Exception; - public void setProperty(Object src, XmlPullParser parser, Set<String> parsed, boolean strict) throws XmlPullParserException, IOException { + public void setProperty(Object src, + XmlPullParser parser, + Set<String> parsed, boolean strict) + throws XmlPullParserException, IOException { if (onlyOne && parsed.contains(name)) { - throw new XmlPullParserException("Duplicated tag: \'" + parser.getName() + "\'", parser, null); + throw new XmlPullParserException( + "Duplicated tag: \'" + parser.getName() + "\'", + parser, + null + ); } parsed.add(name); try { Modified: trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java =================================================================== --- trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Helper.java 2010-04-12 10:59:27 UTC (rev 693) @@ -28,16 +28,19 @@ package org.nuiton.io.xpp3; -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; - +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.xml.pull.XmlPullParser; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +import org.nuiton.io.xpp3.PropertyMapper.AttributeValueToProperty; +import org.nuiton.io.xpp3.PropertyMapper.TagTextContentToProperty; +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; import java.io.IOException; import java.io.Reader; import java.io.StringReader; @@ -49,11 +52,6 @@ import java.util.Map; import java.util.ServiceLoader; -import org.apache.commons.lang.StringUtils; -import org.codehaus.plexus.util.xml.pull.XmlPullParser; -import org.nuiton.io.xpp3.PropertyMapper.AttributeValueToProperty; -import org.nuiton.io.xpp3.PropertyMapper.TagTextContentToProperty; - /** * A Helper to read some data stored in xml with a {@link Xpp3Reader}. * <p/> @@ -65,10 +63,9 @@ * @since 1.0.3 */ public class Xpp3Helper { - /** - * Logger - */ + /** Logger */ private static final Log log = LogFactory.getLog(Xpp3Helper.class); + /** * les readers enregistres via un {@link ServiceLoader} * sur le contrat {@link Xpp3Reader}. @@ -85,7 +82,8 @@ * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - public static <O> O readObject(Class<O> klass, Reader reader) throws IOException, XmlPullParserException { + public static <O> O readObject(Class<O> klass, Reader reader) + throws IOException, XmlPullParserException { if (klass == null) { throw new NullPointerException("klass parameter can not be null"); @@ -98,7 +96,8 @@ Xpp3Reader<O> modelReader = getReader(klass); if (modelReader == null) { - throw new IllegalArgumentException("could not find xpp3Reader for type " + klass); + throw new IllegalArgumentException( + "could not find xpp3Reader for type " + klass); } O result = null; @@ -111,7 +110,7 @@ String rawInput = sWriter.toString(); if (log.isDebugEnabled()) { - log.debug("content to read : \n"+rawInput); + log.debug("content to read : \n" + rawInput); } StringReader sReader = new StringReader(rawInput); @@ -134,7 +133,8 @@ * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - public static <O> O[] readObjects(Class<O> klass, Reader reader) throws IOException, XmlPullParserException { + public static <O> O[] readObjects(Class<O> klass, Reader reader) + throws IOException, XmlPullParserException { if (klass == null) { throw new NullPointerException("klass parameter can not be null"); @@ -147,7 +147,8 @@ Xpp3Reader<O> modelReader = getReader(klass); if (modelReader == null) { - throw new IllegalArgumentException("could not find xpp3Reader for type " + klass); + throw new IllegalArgumentException( + "could not find xpp3Reader for type " + klass); } O[] result = null; @@ -160,7 +161,7 @@ String rawInput = sWriter.toString(); if (log.isDebugEnabled()) { - log.debug("content to read : \n"+rawInput); + log.debug("content to read : \n" + rawInput); } StringReader sReader = new StringReader(rawInput); @@ -173,19 +174,19 @@ return result; } - /** - * @return an iterator on all registred {@link Xpp3Reader}. - */ + /** @return an iterator on all registred {@link Xpp3Reader}. */ public static Iterator<Xpp3Reader<?>> getReaderItetator() { return getReaders().values().iterator(); } /** - * Obtain the loaded reader which match his {@link Xpp3Reader#getType()} whith - * the given type. + * Obtain the loaded reader which match his {@link Xpp3Reader#getType()} + * with the given type. * - * @param <T> the type of the data which should be parsed by the researched parser - * @param klass the type of the data which should be parsed by the researched parser + * @param <T> the type of the data which should be parsed by the + * researched parser + * @param klass the type of the data which should be parsed by the + * researched parser * @return the parser for the given type */ public static <T> Xpp3Reader<T> getReader(Class<T> klass) { @@ -218,7 +219,8 @@ * @param parser the parser to configure * @throws XmlPullParserException if any pb */ - public static void addDefaultEntities(XmlPullParser parser) throws XmlPullParserException { + public static void addDefaultEntities(XmlPullParser parser) + throws XmlPullParserException { // ---------------------------------------------------------------------- // Latin 1 entities // ---------------------------------------------------------------------- @@ -478,23 +480,59 @@ parser.defineEntityReplacementText("diams", "\u2666"); } - public static void addTagTextContentMappers(Class<?> containerType, DataConverter type, boolean onlyOne, Map<String, PropertyMapper> allMappers, String... tagNames) throws IntrospectionException { + public static void addTagTextContentMappers( + Class<?> containerType, + DataConverter type, + boolean onlyOne, + Map<String, PropertyMapper> allMappers, + String... tagNames) throws IntrospectionException { try { - addMappers(TagTextContentToProperty.class, containerType, type, onlyOne, allMappers, tagNames); + addMappers(TagTextContentToProperty.class, + containerType, + type, + onlyOne, + allMappers, + tagNames + ); } catch (Exception ex) { - throw new RuntimeException("could not addMappers for reason : " + ex.getMessage(), ex); + throw new RuntimeException( + "could not addMappers for reason : " + ex.getMessage(), ex); } } - public static void addAttributeValueMappers(Class<?> containerType, DataConverter type, boolean onlyOne, Map<String, PropertyMapper> allMappers, String... tagNames) throws IntrospectionException { + public static void addAttributeValueMappers( + Class<?> containerType, + DataConverter type, + boolean onlyOne, + Map<String, PropertyMapper> allMappers, + String... tagNames) throws IntrospectionException { try { - addMappers(AttributeValueToProperty.class, containerType, type, onlyOne, allMappers, tagNames); + addMappers(AttributeValueToProperty.class, + containerType, + type, + onlyOne, + allMappers, + tagNames + ); } catch (Exception ex) { - throw new RuntimeException("could not addMappers for reason : " + ex.getMessage(), ex); + throw new RuntimeException( + "could not addMappers for reason : " + ex.getMessage(), ex); } } - protected static void addMappers(Class<? extends PropertyMapper> mapperClass, Class<?> containerType, DataConverter type, boolean onlyOne, Map<String, PropertyMapper> allMappers, String... tagNames) throws IntrospectionException, NoSuchMethodException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { + protected static void addMappers( + Class<? extends PropertyMapper> mapperClass, + Class<?> containerType, + DataConverter type, + boolean onlyOne, + Map<String, PropertyMapper> allMappers, + String... tagNames) + throws IntrospectionException, + NoSuchMethodException, + InstantiationException, + IllegalAccessException, + IllegalArgumentException, + InvocationTargetException { for (String tagName : tagNames) { // the tag-name is transformed to tagName @@ -510,18 +548,37 @@ String propertyName = buffer.toString(); BeanInfo beanInfo = Introspector.getBeanInfo(containerType); PropertyDescriptor descriptor = null; - for (PropertyDescriptor propertyDescriptor : beanInfo.getPropertyDescriptors()) { + for (PropertyDescriptor propertyDescriptor : + beanInfo.getPropertyDescriptors()) { if (propertyDescriptor.getName().equals(propertyName)) { descriptor = propertyDescriptor; break; } } if (descriptor == null) { - throw new IllegalArgumentException("could not find a property descriptor for property " + propertyName + " of " + containerType); + throw new IllegalArgumentException( + "could not find a property descriptor for property " + + propertyName + " of " + containerType); } - Constructor<? extends PropertyMapper> constructor = mapperClass.getConstructor(String.class, String.class, Class.class, DataConverter.class, boolean.class, PropertyDescriptor.class); + Constructor<? extends PropertyMapper> constructor = + mapperClass.getConstructor( + String.class, + String.class, + Class.class, + DataConverter.class, + boolean.class, + PropertyDescriptor.class + ); - PropertyMapper mapper = constructor.newInstance(tagName, propertyName, containerType, type, onlyOne, descriptor); + PropertyMapper mapper = + constructor.newInstance( + tagName, + propertyName, + containerType, + type, + onlyOne, + descriptor + ); // System.out.println("adding a mapper " + mapper); allMappers.put(containerType.getName() + "#" + tagName, mapper); @@ -541,7 +598,9 @@ protected static Map<Class<?>, Xpp3Reader<?>> getReaders() { if (readers == null) { readers = new HashMap<Class<?>, Xpp3Reader<?>>(); - for (Xpp3Reader<?> r : ServiceLoader.load(Xpp3Reader.class, Xpp3Helper.class.getClassLoader())) { + for (Xpp3Reader<?> r : ServiceLoader.load( + Xpp3Reader.class, + Xpp3Helper.class.getClassLoader())) { readers.put(r.getType(), r); } Modified: trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java =================================================================== --- trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/io/xpp3/Xpp3Reader.java 2010-04-12 10:59:27 UTC (rev 693) @@ -45,7 +45,7 @@ * <p/> * to make possible auto-discovering of availables reader at runtime. * <p/> - * See {@link Xpp3Helper#getReader(java.lang.Class)} and + * See {@link Xpp3Helper#getReader(Class)} and * {@link Xpp3Helper#getReaders()}. * * @author tchemit <chemit@codelutin.com> @@ -54,16 +54,14 @@ */ public interface Xpp3Reader<O> { - /** - * @return the type of main object to read - */ + /** @return the type of main object to read */ Class<O> getType(); /** * Read a single instance of the typed object and return it. * <p/> * Note : this is a convinient method to call - * {@link #read(java.io.Reader, boolean)} in strict mode. + * {@link #read(Reader, boolean)} in strict mode. * <p/> * In the xml stream, the root tag must be the {@link #getRootTagName()}. * <p/> @@ -99,15 +97,17 @@ * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - O read(Reader reader, boolean strict) throws IOException, XmlPullParserException; + O read(Reader reader, boolean strict) throws IOException, + XmlPullParserException; /** * Read some instances of the typed object and return it. * <p/> - * In the xml stream, the root tag must be the {@link #getArrayRootTagName()}. + * In the xml stream, the root tag must be the + * {@link #getArrayRootTagName()}. * <p/> * Note : this is a convinient method to call : - * {@link #readArray(java.io.Reader, boolean)} in stritc mode. + * {@link #readArray(Reader, boolean)} in stritc mode. * <p/> * Example : * <pre> @@ -128,7 +128,8 @@ /** * Read some instances of the typed object and return it. * <p/> - * In the xml stream, the root tag must be the {@link #getArrayRootTagName()}. + * In the xml stream, the root tag must be the + * {@link #getArrayRootTagName()}. * <p/> * Example : * <pre> @@ -145,11 +146,10 @@ * @throws IOException if any io pb * @throws XmlPullParserException if any parsing pb */ - O[] readArray(Reader reader, boolean strict) throws IOException, XmlPullParserException; + O[] readArray(Reader reader, boolean strict) throws IOException, + XmlPullParserException; - /** - * @return the name of the root tag of a object to read - */ + /** @return the name of the root tag of a object to read */ String getRootTagName(); /** @@ -159,9 +159,7 @@ */ void setRootTagName(String rootTagName); - /** - * @return the name of the root tag of an array of objets to read - */ + /** @return the name of the root tag of an array of objets to read */ String getArrayRootTagName(); /** Modified: trunk/src/main/java/org/nuiton/plugin/AbstractPlugin.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/AbstractPlugin.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/AbstractPlugin.java 2010-04-12 10:59:27 UTC (rev 693) @@ -405,10 +405,11 @@ * @param updater an updater (will give the mirrored files) * @return the map of mirrored files associated to their files in srcDir */ - protected Map<String, String> getFilesToTreate(String[] includes, - String[] excludes, - File srcDir, - MirroredFileUpdater updater) { + protected Map<String, String> getFilesToTreate( + String[] includes, + String[] excludes, + File srcDir, + MirroredFileUpdater updater) { Map<String, String> result = new TreeMap<String, String>(); @@ -497,8 +498,8 @@ } /** - * Add a given directory in maven project's test compile source roots (if not - * already present). + * Add a given directory in maven project's test compile source roots + * (if not already present). * * @param srcDir the location to include in test compile source roots */ @@ -639,10 +640,14 @@ * @param project the maven project * @param src the source directory * @param addSourcesToClassPath a flag to a maven sources to classLoader - * @param testPhase a flag to specify if we are in a test phase (changes the classLoader) - * @param addResourcesToClassPath flag to add maven's resources to classLoader - * @param addCompileClassPath flag to add maven's project compile classPath to classLoader - * @param addProjectClassPath flag to add maven'es project dependecies to classLoader + * @param testPhase a flag to specify if we are in a + * test phase (changes the classLoader) + * @param addResourcesToClassPath flag to add maven's resources to + * classLoader + * @param addCompileClassPath flag to add maven's project compile + * classPath to classLoader + * @param addProjectClassPath flag to add maven'es project dependecies + * to classLoader * @return the new classLoader * @throws MalformedURLException if an url was not correct */ @@ -695,7 +700,8 @@ } if (addProjectClassPath) { getLog().info("use project compile scope class-path"); - // add also all dependencies of the project in compile scope + // add also all dependencies of the project in compile + // scope Set<?> artifacts = project.getArtifacts(); for (Object o : artifacts) { Artifact a = (Artifact) o; @@ -733,9 +739,9 @@ /** * Add the given {@code directory} in {@code urls} if not already included. * <p/> - * <b>Note:</b> We use a extra list to store file string representation, since - * we do NOT want any url resolution and the {@link URL#equals(Object)} is - * doing some... + * <b>Note:</b> We use a extra list to store file string representation, + * since we do NOT want any url resolution and the + * {@link URL#equals(Object)} is doing some... * * @param directory the directory to insert in {@code urls} * @param urls list of urls @@ -764,7 +770,10 @@ * @param done list of string representation of urls * @since 1.1.0 */ - protected void addUrlToUrlsList(URL url, List<URL> urls, Set<String> done) { + protected void addUrlToUrlsList(URL url, + List<URL> urls, + Set<String> done) { + // do the comparaison on a String to avoid url to be resolved // (in URL.equals method) String u = url.toString(); @@ -793,7 +802,8 @@ } /** - * Check that the given resource exists in a simple fs file or in the classPath. + * Check that the given resource exists in a simple fs file or in the + * classPath. * * @param f the required resource file. * @throws IOException for any error while looking up for the resources Modified: trunk/src/main/java/org/nuiton/plugin/DependencyUtil.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/DependencyUtil.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/DependencyUtil.java 2010-04-12 10:59:27 UTC (rev 693) @@ -28,18 +28,16 @@ package org.nuiton.plugin; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.maven.artifact.Artifact; import org.apache.maven.shared.dependency.tree.DependencyNode; +import java.util.*; + /** * Une classe de methodes utiles sur les dependences entre artifacts. - * + * * @author tchemit <chemit@codelutin.com> * @since 0.5 */ @@ -48,13 +46,16 @@ /** to use log facility, just put in your code: log.info(\"...\"); */ private static final Log log = LogFactory.getLog(DependencyUtil.class); - public static void sortArtifacts(DependencyNode rootNode, List<Artifact> artifacts, boolean verbose) { + public static void sortArtifacts(DependencyNode rootNode, + List<Artifact> artifacts, + boolean verbose) { if (artifacts.size() == 1) { return; } - Map<String, ArtifactDependencyEntry> dico = new java.util.HashMap<String, ArtifactDependencyEntry>(artifacts.size()); + Map<String, ArtifactDependencyEntry> dico = + new HashMap<String, ArtifactDependencyEntry>(artifacts.size()); for (Artifact a : artifacts) { ArtifactDependencyEntry entry = new ArtifactDependencyEntry(a); @@ -62,28 +63,33 @@ } // contient les artifacts non encore fixes - Set<String> universe = new java.util.HashSet<String>(dico.keySet()); + Set<String> universe = new HashSet<String>(dico.keySet()); // recupere les noeuds pour chaque artifact en une seule passe setNodes(rootNode, dico, universe, verbose); // contient les artifacts resouds dans l'ordre de dependances - List<String> parsed = new java.util.ArrayList<String>(); + List<String> parsed = new ArrayList<String>(); // premiere passe pour recuperer l'ensemble des dependances for (ArtifactDependencyEntry entry : dico.values()) { - List<String> dependencies = getDependencies(rootNode, entry, universe, verbose); + List<String> dependencies = getDependencies(rootNode, + entry, + universe, + verbose + ); entry.depIds = dependencies; } int level = 0; do { if (verbose) { - log.info("run into level " + (level++)); + log.info("run into level " + level++); } - // on parcourt les artifacts pour detecter les nouveau artifacts fixes - List<String> levelFixed = new java.util.ArrayList<String>(); + // on parcourt les artifacts pour detecter les nouveau + // artifacts fixes + List<String> levelFixed = new ArrayList<String>(); for (String key : universe) { ArtifactDependencyEntry entry = dico.get(key); @@ -99,7 +105,8 @@ if (levelFixed.isEmpty()) { // aucune modification, c'est un cycle! - throw new IllegalStateException("cycle detecte ! entre les artifacts " + universe); + throw new IllegalStateException( + "cycle detecte ! entre les artifacts " + universe); } // on met a jour les listes @@ -131,22 +138,39 @@ return artifact.getArtifactId() + ":" + artifact.getGroupId(); } - protected static List<String> getDependencies(DependencyNode rootNode, ArtifactDependencyEntry entry, Set<String> universe, boolean verbose) { + protected static List<String> getDependencies( + DependencyNode rootNode, + ArtifactDependencyEntry entry, + Set<String> universe, + boolean verbose) { - List<String> order = new java.util.ArrayList<String>(); - Set<String> exclude = new java.util.HashSet<String>(); + List<String> order = new ArrayList<String>(); + Set<String> exclude = new HashSet<String>(); if (verbose) { log.info("start [" + entry.artifactKey + "]"); } DependencyNode node = entry.node; - getDependencies(rootNode, node, entry.artifactKey, universe, verbose, order, exclude); + getDependencies(rootNode, + node, + entry.artifactKey, + universe, + verbose, + order, + exclude + ); return order; } - private static void getDependencies(DependencyNode rootNode, DependencyNode node, String artifactKey, Set<String> universe, boolean verbose, List<String> order, Set<String> exclude) { + private static void getDependencies(DependencyNode rootNode, + DependencyNode node, + String artifactKey, + Set<String> universe, + boolean verbose, + List<String> order, + Set<String> exclude) { for (Iterator<?> itr = node.preorderIterator(); itr.hasNext();) { DependencyNode d = (DependencyNode) itr.next(); @@ -164,10 +188,18 @@ if (d.getState() != DependencyNode.INCLUDED) { // on doit recuperer le noeud complete if (log.isDebugEnabled()) { - log.debug("!!! doit recuperer le noeud complet pour " + d.getArtifact()); + log.debug("!!! doit recuperer le noeud complet pour " + + d.getArtifact()); } DependencyNode node1 = getNode(rootNode, key, verbose); - getDependencies(rootNode, node1, artifactKey, universe, verbose, order, exclude); + getDependencies(rootNode, + node1, + artifactKey, + universe, + verbose, + order, + exclude + ); } if (log.isDebugEnabled()) { @@ -189,7 +221,10 @@ } - protected static void setNodes(DependencyNode rootNode, Map<String, ArtifactDependencyEntry> dico, Set<String> universe, boolean verbose) { + protected static void setNodes(DependencyNode rootNode, + Map<String, ArtifactDependencyEntry> dico, + Set<String> universe, + boolean verbose) { for (Iterator<?> itr = rootNode.preorderIterator(); itr.hasNext();) { DependencyNode d = (DependencyNode) itr.next(); @@ -198,13 +233,16 @@ if (log.isDebugEnabled()) { log.debug("key : " + key); } - if (universe.contains(key) && d.getState() == DependencyNode.INCLUDED) { + if (universe.contains(key) && + d.getState() == DependencyNode.INCLUDED) { ArtifactDependencyEntry entry = dico.get(key); entry.node = d; - if (d == null) { - // ce cas ne devrait jamais arrive - throw new IllegalStateException("on a pas trouve le node pour l'artifact " + artifact); - } +// if (d == null) { +// // ce cas ne devrait jamais arrive +// throw new IllegalStateException( +// "on a pas trouve le node pour l'artifact " + +// artifact); +// } if (log.isDebugEnabled()) { log.debug("detected node : " + d); } @@ -212,7 +250,9 @@ } } - protected static DependencyNode getNode(DependencyNode rootNode, String requiredKey, boolean verbose) { + protected static DependencyNode getNode(DependencyNode rootNode, + String requiredKey, + boolean verbose) { for (Iterator<?> itr = rootNode.preorderIterator(); itr.hasNext();) { DependencyNode d = (DependencyNode) itr.next(); @@ -221,7 +261,8 @@ if (log.isDebugEnabled()) { log.debug("key : " + key); } - if (requiredKey.equals(key) && d.getState() == DependencyNode.INCLUDED) { + if (requiredKey.equals(key) && + d.getState() == DependencyNode.INCLUDED) { return d; } } @@ -232,13 +273,16 @@ public static class ArtifactDependencyEntry { protected final Artifact artifact; + protected final String artifactKey; + protected DependencyNode node; + protected List<String> depIds; public ArtifactDependencyEntry(Artifact artifact) { this.artifact = artifact; - this.artifactKey = getArtifactId(artifact); + artifactKey = getArtifactId(artifact); } } } Modified: trunk/src/main/java/org/nuiton/plugin/Plugin.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/Plugin.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/Plugin.java 2010-04-12 10:59:27 UTC (rev 693) @@ -41,27 +41,20 @@ */ public interface Plugin extends Mojo { - /** - * An enumeration to qualify the init result of a plugin - */ + /** An enumeration to qualify the init result of a plugin */ enum InitState { - /** - * when something is wrong and should throw an error - */ + + /** when something is wrong and should throw an error */ failed, - /** - * when the plugin execution should be skipped - */ + + /** when the plugin execution should be skipped */ skip, - /** - * when plugin can be executed - */ + + /** when plugin can be executed */ ok } - /** - * An enumeration to qualify a maven module packaging - */ + /** An enumeration to qualify a maven module packaging */ enum Packaging { pom, Modified: trunk/src/main/java/org/nuiton/plugin/PluginHelper.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/PluginHelper.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/PluginHelper.java 2010-04-12 10:59:27 UTC (rev 693) @@ -90,7 +90,7 @@ if (!type.isAssignableFrom(o.getClass())) { throw new IllegalArgumentException( "can not cast List with object of type " + - o.getClass() + " to " + type + " type!"); + o.getClass() + " to " + type + " type!"); } } return (List<O>) list; @@ -98,11 +98,13 @@ static final protected double[] timeFactors = {1000000, 1000, 60, 60, 24}; - static final protected String[] timeUnites = {"ns", "ms", "s", "m", "h", "d"}; + static final protected String[] timeUnites = {"ns", "ms", "s", "m", "h", + "d"}; static final protected double[] memoryFactors = {1024, 1024, 1024, 1024}; - static final protected String[] memoryUnites = {"o", "Ko", "Mo", "Go", "To"}; + static final protected String[] memoryUnites = {"o", "Ko", "Mo", "Go", + "To"}; static public String convertMemory(long value) { return convert(value, memoryFactors, memoryUnites); @@ -291,7 +293,8 @@ * @throws IOException if could not create directory * @since 1.1.1 */ - public static boolean createDirectoryIfNecessary(File dir) throws IOException { + public static boolean createDirectoryIfNecessary( + File dir) throws IOException { if (!dir.exists()) { boolean b = dir.mkdirs(); if (!b) { @@ -358,7 +361,7 @@ if (!b) { throw new IOException( "could not changed lastModified [" + lastModified + - "] for " + file); + "] for " + file); } } @@ -543,12 +546,18 @@ String name = nextElement.getName(); for (String include : includes) { if (DirectoryScanner.match(include, name)) { - System.out.println("matching name : " + name + " with pattern " + include); + System.out.println("matching name : " + name + + " with pattern " + include); File dstFile = new File(dst, name); - if (overwrite || !dstFile.exists() || nextElement.getTime() > dstFile.lastModified()) { - System.out.println("will expand : " + name + " to " + dstFile); - InputStream inputStream = zipFile.getInputStream(nextElement); - FileOutputStream outStream = new FileOutputStream(dstFile); + if (overwrite || + !dstFile.exists() || + nextElement.getTime() > dstFile.lastModified()) { + System.out.println("will expand : " + name + " to " + + dstFile); + InputStream inputStream = + zipFile.getInputStream(nextElement); + FileOutputStream outStream = + new FileOutputStream(dstFile); try { IOUtil.copy(inputStream, outStream, 2048); } finally { Modified: trunk/src/main/java/org/nuiton/plugin/PluginIOContext.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/PluginIOContext.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/PluginIOContext.java 2010-04-12 10:59:27 UTC (rev 693) @@ -32,20 +32,20 @@ /** * Une classe pour définir les entrées-sortie d'un plugin. - * + * <p/> * En entrée, on peut avoir un ou plusieurs répertoires ({@link #inputs}. * <p/> * En sortie, on ne peut avoir qu'un seul répertoire ({@link #output}. - * * * @author tchemit <chemit@codelutin.com> * @since 1.0.1 */ public class PluginIOContext { - File[] inputs; - File output; + protected File[] inputs; + protected File output; + public File[] getInputs() { return inputs; } @@ -55,7 +55,7 @@ } public void setInput(File input) { - this.inputs = new File[]{input}; + inputs = new File[]{input}; } public void setInputs(File[] inputs) { Modified: trunk/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java =================================================================== --- trunk/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/main/java/org/nuiton/plugin/VelocityTemplateGenerator.java 2010-04-12 10:59:27 UTC (rev 693) @@ -41,8 +41,15 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */package org.nuiton.plugin; + */ +package org.nuiton.plugin; +import org.apache.maven.project.MavenProject; +import org.apache.velocity.Template; +import org.apache.velocity.VelocityContext; +import org.apache.velocity.app.VelocityEngine; +import org.apache.velocity.runtime.resource.loader.JarResourceLoader; + import java.io.File; import java.io.FileWriter; import java.io.Writer; @@ -50,26 +57,24 @@ import java.net.URL; import java.util.Properties; -import org.apache.maven.project.MavenProject; -import org.apache.velocity.Template; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.VelocityEngine; - /** * Generator of template base on velocity. * * @author tchemit <chemit@codelutin.com> * @since 1.3 - * - * TODO TC-20091011 should use plexus velocity component + * <p/> + * TODO TC-20091011 should use plexus velocity component */ public class VelocityTemplateGenerator { protected VelocityEngine engine; + protected MavenProject mavenProject; + protected Template velocityTemplate; - public VelocityTemplateGenerator(MavenProject mavenProject, URL template) throws URISyntaxException { + public VelocityTemplateGenerator(MavenProject mavenProject, + URL template) throws URISyntaxException { if (mavenProject == null) { throw new IllegalArgumentException("mavenProject must not be null"); @@ -91,8 +96,15 @@ props = new Properties(); props.setProperty("resource.loader", "jar"); - props.setProperty("jar.resource.loader.description", "Jar resource loader for default webstart templates"); - props.setProperty("jar.resource.loader.class", "org.apache.velocity.runtime.resource.loader.JarResourceLoader"); + props.setProperty( + "jar.resource.loader.description", + "Jar resource loader for default webstart templates" + ); + props.setProperty( + "jar.resource.loader.class", + JarResourceLoader.class.getName() + //"org.apache.velocity.runtime.resource.loader.JarResourceLoader" + ); // obtain the jar url @@ -100,7 +112,8 @@ int i = url.indexOf("!"); templateName = url.substring(i + 2); - props.setProperty("jar.resource.loader.path", url.substring(0, i + 2)); + props.setProperty("jar.resource.loader.path", + url.substring(0, i + 2)); } else { @@ -114,16 +127,19 @@ engine = new VelocityEngine(); engine.init(props); } catch (Exception e) { - IllegalArgumentException iae = new IllegalArgumentException("Could not initialise Velocity"); + IllegalArgumentException iae = new IllegalArgumentException( + "Could not initialise Velocity"); iae.initCause(e); throw iae; } try { - this.velocityTemplate = engine.getTemplate(templateName); + velocityTemplate = engine.getTemplate(templateName); } catch (Exception e) { IllegalArgumentException iae = - new IllegalArgumentException("Could not load the template file from '" + template + "'"); + new IllegalArgumentException( + "Could not load the template file from '" + + template + "'"); iae.initCause(e); throw iae; } @@ -133,7 +149,8 @@ VelocityContext vcontext = new VelocityContext(); - // Note: properties that contain dots will not be properly parsed by Velocity. Should we replace dots with underscores ? + // Note: properties that contain dots will not be properly parsed by + // Velocity. Should we replace dots with underscores ? addPropertiesToContext(System.getProperties(), vcontext); addPropertiesToContext(mavenProject.getProperties(), vcontext); @@ -145,7 +162,9 @@ velocityTemplate.merge(vcontext, writer); writer.flush(); } catch (Exception e) { - throw new Exception("Could not generate the template " + velocityTemplate.getName() + ": " + e.getMessage(), e); + throw new Exception( + "Could not generate the template " + + velocityTemplate.getName() + ": " + e.getMessage(), e); } finally { writer.close(); } @@ -156,7 +175,8 @@ VelocityContext vcontext = new VelocityContext(); - // Note: properties that contain dots will not be properly parsed by Velocity. Should we replace dots with underscores ? + // Note: properties that contain dots will not be properly parsed by + // Velocity. Should we replace dots with underscores ? addPropertiesToContext(System.getProperties(), vcontext); addPropertiesToContext(mavenProject.getProperties(), vcontext); @@ -172,13 +192,16 @@ velocityTemplate.merge(vcontext, writer); writer.flush(); } catch (Exception e) { - throw new Exception("Could not generate the template " + velocityTemplate.getName() + ": " + e.getMessage(), e); + throw new Exception( + "Could not generate the template " + + velocityTemplate.getName() + ": " + e.getMessage(), e); } finally { writer.close(); } } - protected void addPropertiesToContext(Properties properties, VelocityContext context) { + protected void addPropertiesToContext(Properties properties, + VelocityContext context) { for (Object o : properties.keySet()) { String key = (String) o; Modified: trunk/src/site/apt/mojo-examples.apt =================================================================== --- trunk/src/site/apt/mojo-examples.apt 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/site/apt/mojo-examples.apt 2010-04-12 10:59:27 UTC (rev 693) @@ -43,4 +43,4 @@ share-server-secret - <<todo>> \ No newline at end of file + <<todo>> Modified: trunk/src/site/apt/mojo-testFramework.apt =================================================================== --- trunk/src/site/apt/mojo-testFramework.apt 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/site/apt/mojo-testFramework.apt 2010-04-12 10:59:27 UTC (rev 693) @@ -39,7 +39,7 @@ The <mojo test framework> aims to simplify the writing of tests on a mojo. - To use this framework, your mojo classes <<MUST>> implement the contract + To use this framework, your mojo classes <<MUST>> implements the contract <<org.nuiton.plugin.Plugin>>. The framework use these technologies : Modified: trunk/src/site/site_en.xml =================================================================== --- trunk/src/site/site_en.xml 2010-04-10 20:36:03 UTC (rev 692) +++ trunk/src/site/site_en.xml 2010-04-12 10:59:27 UTC (rev 693) @@ -2,6 +2,7 @@ <!-- #%L Maven helper plugin + $Author$ $LastChangedDate$ $LastChangedRevision$ @@ -28,56 +29,64 @@ <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"/> - </poweredBy> + <poweredBy> + <logo href="http://maven.apache.org" name="Maven" + img="images/logos/maven-feather.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="Goals" href="plugin-info.html"> - <item name="collect-files" href="collect-files-mojo.html"/> - <item name="share-server-secret" href="share-server-secret-mojo.html"/> - <item name="send-email" href="send-email-mojo.html"/> - <item name="help" href="help-mojo.html"/> - </item> - <item name="Mojo usages" href="mojo-usages.html"/> - <item name="Mojo examples" href="mojo-examples.html"/> - </menu> + <menu name="User"> + <item name="Introduction" href="index.html"/> + <item name="Goals" href="plugin-info.html"> + <item name="collect-files" href="collect-files-mojo.html"/> + <item name="share-server-secret" href="share-server-secret-mojo.html"/> + <item name="send-email" href="send-email-mojo.html"/> + <item name="help" href="help-mojo.html"/> + </item> + <item name="Mojo usages" href="mojo-usages.html"/> + <item name="Mojo examples" href="mojo-examples.html"/> + </menu> - <menu name="Developer"> - <item name="Mojo framework" href="mojo-framework.html"/> - <item name="Mojo test framework" href="mojo-testFramework.html"/> - <item name="A faire" href="Todo.html"/> - </menu> + <menu name="Developer"> + <item name="Mojo framework" href="mojo-framework.html"/> + <item name="Mojo test framework" href="mojo-testFramework.html"/> + <item name="A faire" href="Todo.html"/> + </menu> - <menu name="Download"> - <item href="http://nuiton.org/projects/list_files/maven-helper-plugin" name="Sources bundles"/> - <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)"/> - <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-tests.jar" - name="Test Librairie (jar)"/> - <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-test-javadoc.jar" - name="Test Javadoc (jar)"/> - <item href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-test-sources.jar" - name="Test Sources (jar)"/> - </menu> + <menu name="Download"> + <item href="http://nuiton.org/projects/list_files/maven-helper-plugin" + name="Sources bundles"/> + <item + href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}.jar" + name="Library (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)"/> + <item + href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-tests.jar" + name="Test Library (jar)"/> + <item + href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-test-javadoc.jar" + name="Test Javadoc (jar)"/> + <item + href="${repository.home.url}/org/nuiton/${project.artifactId}/${project.version}/${project.build.finalName}-test-sources.jar" + name="Test Sources (jar)"/> + </menu> - <menu ref="reports"/> + <menu ref="reports"/> - </body> + </body> </project>