Jredmine-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- 579 discussions
Author: tchemit
Date: 2010-01-07 04:26:24 +0100 (Thu, 07 Jan 2010)
New Revision: 73
Modified:
trunk/pom.xml
Log:
use mavenpom 1.1.4
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-01-07 00:11:58 UTC (rev 72)
+++ trunk/pom.xml 2010-01-07 03:26:24 UTC (rev 73)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom</artifactId>
- <version>1.1.3</version>
+ <version>1.1.4</version>
</parent>
<!--<groupId>org.nuiton</groupId>-->
1
0
07 Jan '10
Author: tchemit
Date: 2010-01-07 01:11:58 +0100 (Thu, 07 Jan 2010)
New Revision: 72
Modified:
trunk/jredmine-client/pom.xml
trunk/maven-jredmine-plugin/pom.xml
trunk/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/jredmine-client/pom.xml
===================================================================
--- trunk/jredmine-client/pom.xml 2010-01-07 00:11:53 UTC (rev 71)
+++ trunk/jredmine-client/pom.xml 2010-01-07 00:11:58 UTC (rev 72)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.1</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
Modified: trunk/maven-jredmine-plugin/pom.xml
===================================================================
--- trunk/maven-jredmine-plugin/pom.xml 2010-01-07 00:11:53 UTC (rev 71)
+++ trunk/maven-jredmine-plugin/pom.xml 2010-01-07 00:11:58 UTC (rev 72)
@@ -9,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.1</version>
+ <version>1.1.1-SNAPSHOT</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-01-07 00:11:53 UTC (rev 71)
+++ trunk/pom.xml 2010-01-07 00:11:58 UTC (rev 72)
@@ -15,7 +15,7 @@
<!--<groupId>org.nuiton</groupId>-->
<artifactId>jredmine</artifactId>
- <version>1.1</version>
+ <version>1.1.1-SNAPSHOT</version>
<modules>
<module>jredmine-client</module>
@@ -24,9 +24,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.1</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.1</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jredmine/tags/jredmine-1.1</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/jredmine/trunk</url>
</scm>
<dependencyManagement>
1
0
Author: tchemit
Date: 2010-01-07 01:11:53 +0100 (Thu, 07 Jan 2010)
New Revision: 71
Added:
tags/jredmine-1.1/
Log:
[maven-scm] copy for tag jredmine-1.1
1
0
07 Jan '10
Author: tchemit
Date: 2010-01-07 01:11:43 +0100 (Thu, 07 Jan 2010)
New Revision: 70
Modified:
trunk/jredmine-client/pom.xml
trunk/maven-jredmine-plugin/pom.xml
trunk/pom.xml
Log:
[maven-release-plugin] prepare release jredmine-1.1
Modified: trunk/jredmine-client/pom.xml
===================================================================
--- trunk/jredmine-client/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
+++ trunk/jredmine-client/pom.xml 2010-01-07 00:11:43 UTC (rev 70)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
Modified: trunk/maven-jredmine-plugin/pom.xml
===================================================================
--- trunk/maven-jredmine-plugin/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
+++ trunk/maven-jredmine-plugin/pom.xml 2010-01-07 00:11:43 UTC (rev 70)
@@ -1,7 +1,5 @@
<?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>
@@ -11,7 +9,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>jredmine</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1</version>
</parent>
<groupId>org.nuiton.jredmine</groupId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
+++ trunk/pom.xml 2010-01-07 00:11:43 UTC (rev 70)
@@ -1,7 +1,5 @@
<?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>
@@ -17,7 +15,7 @@
<!--<groupId>org.nuiton</groupId>-->
<artifactId>jredmine</artifactId>
- <version>1.0.3-SNAPSHOT</version>
+ <version>1.1</version>
<modules>
<module>jredmine-client</module>
@@ -26,9 +24,9 @@
<!-- Source control management. -->
<scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jredmine/trunk</url>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.1</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/tags/jredmine-1.1</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/jredmine/tags/jredmine-1.1</url>
</scm>
<dependencyManagement>
1
0
r69 - in trunk: . jredmine-client jredmine-client/src/site maven-jredmine-plugin maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report maven-jredmine-plugin/src/site maven-jredmine-plugin/src/site/apt src/site
by tchemit@users.nuiton.org 06 Jan '10
by tchemit@users.nuiton.org 06 Jan '10
06 Jan '10
Author: tchemit
Date: 2010-01-07 00:55:31 +0100 (Thu, 07 Jan 2010)
New Revision: 69
Added:
trunk/jredmine-client/src/site/site_fr.xml
trunk/maven-jredmine-plugin/src/site/site_fr.xml
trunk/src/site/site_fr.xml
Removed:
trunk/jredmine-client/src/site/site.xml
trunk/maven-jredmine-plugin/src/site/site.xml
trunk/src/site/site.xml
Modified:
trunk/jredmine-client/pom.xml
trunk/maven-jredmine-plugin/pom.xml
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
trunk/maven-jredmine-plugin/src/site/apt/index.apt
trunk/maven-jredmine-plugin/src/site/apt/usage.apt
trunk/pom.xml
Log:
Evolution #187: Utilisation de mavenpom Evolution #82: faire la documentation
Modified: trunk/jredmine-client/pom.xml
===================================================================
--- trunk/jredmine-client/pom.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/jredmine-client/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -51,10 +51,8 @@
<packaging>jar</packaging>
<properties>
- <redmine.releaseFiles>
- target/${project.artifactId}-${project.version}-deps.zip,
- target/${project.artifactId}-${project.version}-full.zip
- </redmine.releaseFiles>
+ <!-- extra files to include in release -->
+ <redmine.releaseFiles>${redmine.libReleaseFiles}</redmine.releaseFiles>
</properties>
<build>
@@ -64,7 +62,6 @@
<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
- <version>1.2.0</version>
<executions>
<execution>
<goals>
@@ -96,6 +93,13 @@
<artifactId>plexus-maven-plugin</artifactId>
<version>1.3.8</version>
</plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.3</version>
+ </plugin>
+
</plugins>
</reporting>
<!-- ************************************************************* -->
@@ -118,32 +122,6 @@
<build>
<plugins>
- <!-- always compute test source jar -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- always compute test javadoc jar -->
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-javadocs</id>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
<!-- launch in a release the assembly, but not attach it to project -->
<plugin>
@@ -173,6 +151,7 @@
</build>
</profile>
+
</profiles>
</project>
Deleted: trunk/jredmine-client/src/site/site.xml
===================================================================
--- trunk/jredmine-client/src/site/site.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/jredmine-client/src/site/site.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
- <body>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}"/>
- </breadcrumbs>
-
- <menu ref="parent"/>
-
- <menu name="Utilisateur">
- <item name="Introduction" href="index.html"/>
- <item name="JRedmine rails API" href="rails_api.html"/>
- <item name="JRedmine java service" href="redmine_service.html"/>
- </menu>
-
- <menu name="Développeur">
- <item name="Todo" href="todo.html"/>
- </menu>
-
- <menu name="Téléchargement">
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
- name="Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
- name="Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
- name="Sources (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
- name="Test Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
- name="Test Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
- name="Test Sources (jar)"/>
- </menu>
-
- <menu ref="reports"/>
-
- </body>
-</project>
Copied: trunk/jredmine-client/src/site/site_fr.xml (from rev 67, trunk/jredmine-client/src/site/site.xml)
===================================================================
--- trunk/jredmine-client/src/site/site_fr.xml (rev 0)
+++ trunk/jredmine-client/src/site/site_fr.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="JRedmine rails API" href="rails_api.html"/>
+ <item name="JRedmine java service" href="redmine_service.html"/>
+ </menu>
+
+ <menu name="Développeur">
+ <item name="Todo" href="todo.html"/>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="http://nuiton.org/projects/list_files/jredmine" name="Sources bundles"/>
+
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-tests.jar"
+ name="Test Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-javadoc.jar"
+ name="Test Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/jredmine-client/${project.version}/${project.build.finalName}-test-sources.jar"
+ name="Test Sources (jar)"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Modified: trunk/maven-jredmine-plugin/pom.xml
===================================================================
--- trunk/maven-jredmine-plugin/pom.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/maven-jredmine-plugin/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -101,8 +101,7 @@
<!-- ************************************************************* -->
<name>JRedmine :: Maven plugin</name>
- <description>JRedmine maven plugin to interacts with Redmine's server
- </description>
+ <description>JRedmine maven plugin to interacts with Redmine's server</description>
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
@@ -143,31 +142,6 @@
<version>2.5.1</version>
</plugin>
- <!--plugin>
- <groupId>${project.groupId}</groupId>
- <artifactId>maven-jredmine-plugin</artifactId>
- <version>${project.version}</version>
- <configuration>
- <xmlPath>${maven.changeFile}</xmlPath>
- <issueLinkTemplate>${redmine.url}/issues/show/%ISSUE%</issueLinkTemplate>
- <versionLinkTemplate>${redmine.url}/versions/show/%VERSION%</versionLinkTemplate>
- <onlyCurrentVersion>true</onlyCurrentVersion>
- <columnNames>key,summary,status,assignee,reporter,tracker,priority,version,category,createdOn</columnNames>
- </configuration>
- <reportSets>
- <reportSet>
- <reports>
- <report>issues-report</report>
- <report>issues-report-by-tracker</report>
- <report>issues-report-by-status</report>
- <report>issues-report-by-category</report>
- <report>issues-report-by-priority</report>
- <report>issues-report-by-version</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin-->
-
</plugins>
</reporting>
@@ -210,7 +184,6 @@
<goal>install</goal>
<goal>run</goal>
</goals>
- <!--<phase>validate</phase>-->
</execution>
</executions>
</plugin>
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2010-01-06 23:55:31 UTC (rev 69)
@@ -152,7 +152,7 @@
report.setUrl(url.toString());
report.setIssues(issues);
- report.setUsers(service.getUsers(id));
+ report.setUsers(service.getProjectMembers(id));
report.setIssueCategories(service.getIssueCategories(id));
report.setIssueStatuses(service.getIssueStatuses());
report.setIssuePriorities(service.getIssuePriorities());
Modified: trunk/maven-jredmine-plugin/src/site/apt/index.apt
===================================================================
--- trunk/maven-jredmine-plugin/src/site/apt/index.apt 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/maven-jredmine-plugin/src/site/apt/index.apt 2010-01-06 23:55:31 UTC (rev 69)
@@ -7,26 +7,62 @@
maven-redmine-plugin
- //TODO-FILL_ME
-
-
* Presentation
- //TODO-FILL_ME
+ Le plugin <<maven-jredmine-plugin>> permet d'exécuter des opérations ou de
+ récuperer des données depuis un serveur redmine qui a installé le plugin
+ rails <<jredmine>>.
* Goals Overview
The plugin has the following goals:
- //TODO-FILL_ME
+ * {{{display-data-mojo.html}display-data}} display some datas from a redmine server.
+ * {{{generate-changes-mojo.html}generate-changes}} generates the changes.xml files from issues of the project from a redmine server.
+
+ * {{{publish-attachments-mojo.html}publish-attachments}} publish some files as attachment for the version of the project on a redmine server.
+
+ * {{{publish-news-mojo.html}publish-news}} publish a news for the project on a redmine server.
+
+ * {{{generate-email-announcement-mojo.html}generate-email-announcement}} generates the body of the email to send for a release using issues for the redmine server.
+
+ * {{{generate-news-announcement-mojo.html}generate-news-announcement}} generates the body of the announcement's news to publish for a release using issues for the redmine server.
+
+ * {{{update-version-mojo.html}update-version}} update the version of the project (close version) on a redmine server.
+
+ * {{{next-version-mojo.html}next-version}} creates (if not exists) the version fo the project on a redmine server.
+
* {{{help-mojo.html}help}} display help about the plugin (goals, usage).
+* Reports Overview
+
+ The plugin has the following reports:
+
+
+ * {{{issues-report-mojo.html}issues-report}} generates a report for issues from Redmine's server.
+
+ * {{{issues-report-by-tracker-mojo.html}issues-report-by-tracker}} generates a report for issues group by tracker's types from Redmine's server.
+
+ * {{{issues-report-by-assignee-mojo.html}issues-report-by-assignee}} generates a report for issues group by assignee from Redmine's server.
+
+ * {{{issues-report-by-category-mojo.html}issues-report-by-category}} generates a report for issues group by category from Redmine's server.
+
+ * {{{issues-report-by-priority-mojo.html}issues-report-by-priority}} generates a report for issues group by priority from Redmine's server.
+
+ * {{{issues-report-by-reporter-mojo.html}issues-report-by-reporter}} generates a report for issues group by reporter from Redmine's server.
+
+ * {{{issues-report-by-status-mojo.html}issues-report-by-status}} generates a report for issues group by status from Redmine's server.
+
+ * {{{issues-report-by-version-mojo.html}issues-report-by-version}} generates a report for issues group by version from Redmine's server.
+
* Usage
Instructions on how to use the Plugin can be found on {{{usage.html}usage}} page
* Examples
- to be done.
+ Best example is a concrete project.
+
+ Look at what does {{{http://maven.nuiton.org/release/org/nuiton/mavenpom.pom}mavenpom}}.
Modified: trunk/maven-jredmine-plugin/src/site/apt/usage.apt
===================================================================
--- trunk/maven-jredmine-plugin/src/site/apt/usage.apt 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/maven-jredmine-plugin/src/site/apt/usage.apt 2010-01-06 23:55:31 UTC (rev 69)
@@ -9,14 +9,210 @@
------------------------------------------------------------------------------
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-changes</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <generateOnce>true</generateOnce>
+ <actionMapping>fix:1, add:2</actionMapping>
+ <statusIds>3,4,5</statusIds>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+* How does it work ?
+
//TODO-FILL_ME
+
+generate-email-announcement goal
+
------------------------------------------------------------------------------
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-email-announcement</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <urlDownload>
+ ${redmine.url}/projects/list_files/${projectId}
+ </urlDownload>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
* How does it work ?
//TODO-FILL_ME
+generate-news-announcement goal
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-news-announcement</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <urlDownload>
+ ${redmine.url}/projects/list_files/${projectId}
+ </urlDownload>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
+
+update-version goal
+
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>update-version</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <closeVersion>true</closeVersion>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+ or
+
+------------------------------------------------------------------------------
+
+mvn jredmine:update-version -DcloseVersion
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
+
+next-version goal
+
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>next-version</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <previousVersionName>1.0</previousVersionName>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+ or
+
+------------------------------------------------------------------------------
+
+mvn jredmine:next-version -DpreviousVersionName=1.0
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
+
+publish-attachments goal
+
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-attachments</goal>
+ <goal>publish-news</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- for a multi-module just run on root project -->
+ <runOnce>true</runOnce>
+
+ <!-- publish-attachments -->
+ <filesFromProperties>${redmine.collectedFiles}</filesFromProperties>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
+
+publish-news goal
+
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>publish-news</goal>
+ </goals>
+ <phase>validate</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <!-- for a multi-module just run on root project -->
+ <runOnce>true</runOnce>
+
+ <!-- publish-news -->
+ <newsContentFile>
+ target/generated-sources/announcement/release-news-announcement.vm
+ </newsContentFile>
+ <newsSummary>${project.description}</newsSummary>
+ <newsTitle>${project.name} ${project.version} released</newsTitle>
+ </configuration>
+</plugin>
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
+
help goal
This goal display the help of the plugin (available goals).
@@ -25,13 +221,39 @@
------------------------------------------------------------------------------
- mvn license:help
+ mvn jredmine:help
------------------------------------------------------------------------------
To display verbose help :
------------------------------------------------------------------------------
- mvn license:help -Ddetail
+ mvn jredmine:help -Ddetail
------------------------------------------------------------------------------
for full detail see {{{help-mojo.html}help}} detail page.
+
+issues-report report
+
+------------------------------------------------------------------------------
+
+<plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <configuration>
+ <columnNames>
+ key,summary,status,assignee,tracker,priority,version,category,createdOn
+ </columnNames>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>issues-report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+</plugin>
+------------------------------------------------------------------------------
+
+* How does it work ?
+
+ //TODO-FILL_ME
Deleted: trunk/maven-jredmine-plugin/src/site/site.xml
===================================================================
--- trunk/maven-jredmine-plugin/src/site/site.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/maven-jredmine-plugin/src/site/site.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
- <body>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}"/>
- </breadcrumbs>
-
- <menu ref="parent"/>
-
- <menu name="Utilisateur">
- <item name="Introduction" href="index.html"/>
- <item name="Usage" href="usage.html"/>
- <item name="Goals" href="plugin-info.html">
- <item name="generate-changes" href="generate-changes-mojo.html"/>
- <item name="display-data" href="display-data-mojo.html"/>
- <item name="generate-email-announcement" href="generate-email-announcement-mojo.html"/>
- <item name="generate-news-announcement" href="generate-news-announcement-mojo.html"/>
- <item name="update-version" href="update-version-mojo.html"/>
- <item name="next-version" href="next-version-mojo.html"/>
- <item name="publish-news" href="publish-news-mojo.html"/>
- <item name="publish-attachments" href="publish-attachments-mojo.html"/>
- <item name="help" href="help-mojo.html"/>
- </item>
- <item name="Reports" href="plugin-info.html">
- <item name="issues-report" href="issues-report-mojo.html"/>
- <item name="issues-report-by-assignee" href="issues-report-by-assignee-mojo.html"/>
- <item name="issues-report-by-category" href="issues-report-by-category-mojo.html"/>
- <item name="issues-report-by-priority" href="issues-report-by-priority-mojo.html"/>
- <item name="issues-report-by-reporter" href="issues-report-by-reporter-mojo.html"/>
- <item name="issues-report-by-status" href="issues-report-by-status-mojo.html"/>
- <item name="issues-report-by-tracker" href="issues-report-by-tracker-mojo.html"/>
- <item name="issues-report-by-version" href="issues-report-by-version-mojo.html"/>
- </item>
- </menu>
-
- <menu name="Téléchargement">
- <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}.jar"
- name="Librairie (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}-javadoc.jar"
- name="Javadoc (jar)"/>
- <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}-sources.jar"
- name="Sources (jar)"/>
- </menu>
-
- <menu ref="reports"/>
-
- </body>
-</project>
Copied: trunk/maven-jredmine-plugin/src/site/site_fr.xml (from rev 67, trunk/maven-jredmine-plugin/src/site/site.xml)
===================================================================
--- trunk/maven-jredmine-plugin/src/site/site_fr.xml (rev 0)
+++ trunk/maven-jredmine-plugin/src/site/site_fr.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <menu ref="parent"/>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ <item name="Usage" href="usage.html"/>
+ <item name="Goals" href="plugin-info.html">
+ <item name="generate-changes" href="generate-changes-mojo.html"/>
+ <item name="display-data" href="display-data-mojo.html"/>
+ <item name="generate-email-announcement" href="generate-email-announcement-mojo.html"/>
+ <item name="generate-news-announcement" href="generate-news-announcement-mojo.html"/>
+ <item name="update-version" href="update-version-mojo.html"/>
+ <item name="next-version" href="next-version-mojo.html"/>
+ <item name="publish-news" href="publish-news-mojo.html"/>
+ <item name="publish-attachments" href="publish-attachments-mojo.html"/>
+ <item name="help" href="help-mojo.html"/>
+ </item>
+ <item name="Reports" href="plugin-info.html">
+ <item name="issues-report" href="issues-report-mojo.html"/>
+ <item name="issues-report-by-assignee" href="issues-report-by-assignee-mojo.html"/>
+ <item name="issues-report-by-category" href="issues-report-by-category-mojo.html"/>
+ <item name="issues-report-by-priority" href="issues-report-by-priority-mojo.html"/>
+ <item name="issues-report-by-reporter" href="issues-report-by-reporter-mojo.html"/>
+ <item name="issues-report-by-status" href="issues-report-by-status-mojo.html"/>
+ <item name="issues-report-by-tracker" href="issues-report-by-tracker-mojo.html"/>
+ <item name="issues-report-by-version" href="issues-report-by-version-mojo.html"/>
+ </item>
+ </menu>
+
+ <menu name="Téléchargement">
+ <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}.jar"
+ name="Librairie (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}-javadoc.jar"
+ name="Javadoc (jar)"/>
+ <item href="${repository.home.url}/org/nuiton/jredmine/maven-jredmine-plugin/${project.version}/${project.build.finalName}-sources.jar"
+ name="Sources (jar)"/>
+ </menu>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/pom.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -9,7 +9,13 @@
<!-- *** POM Relationships *************************************** -->
<!-- ************************************************************* -->
- <groupId>org.nuiton</groupId>
+ <parent>
+ <groupId>org.nuiton</groupId>
+ <artifactId>mavenpom</artifactId>
+ <version>1.1.3</version>
+ </parent>
+
+ <!--<groupId>org.nuiton</groupId>-->
<artifactId>jredmine</artifactId>
<version>1.0.3-SNAPSHOT</version>
@@ -18,6 +24,13 @@
<module>maven-jredmine-plugin</module>
</modules>
+ <!-- Source control management. -->
+ <scm>
+ <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</connection>
+ <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk</developerConnection>
+ <url>http://www.nuiton.org/repositories/browse/jredmine/trunk</url>
+ </scm>
+
<dependencyManagement>
<dependencies>
@@ -366,14 +379,6 @@
<url>http://maven-site.nuiton.org/jredmine</url>
- <licenses>
- <license>
- <name>Lesser General Public License (LGPL)</name>
- <url>${maven.license.file}</url>
- <distribution>local</distribution>
- </license>
- </licenses>
-
<developers>
<developer>
@@ -389,11 +394,6 @@
</developers>
- <organization>
- <name>CodeLutin</name>
- <url>http://www.codelutin.com/</url>
- </organization>
-
<!-- ************************************************************* -->
<!-- *** Build Settings ****************************************** -->
<!-- ************************************************************* -->
@@ -402,76 +402,11 @@
<properties>
- <platform>nuiton.org</platform>
- <listId>jredmine</listId>
+ <projectId>jredmine</projectId>
- <!-- java level is 1.6 -->
- <maven.compile.source>1.6</maven.compile.source>
- <maven.compile.target>1.6</maven.compile.target>
+ <helper.version>1.2.0</helper.version>
+ <!--<jredmine.version>1.0.2</jredmine.version>-->
- <!-- default encoding -->
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <project.reporting.outputEncoding>UTF-8
- </project.reporting.outputEncoding>
-
- <!-- by default, use maven 2 source base dir -->
- <maven.src.dir>${basedir}/src</maven.src.dir>
-
- <!-- where to generate sources -->
- <maven.gen.dir>${project.build.directory}/generated-sources
- </maven.gen.dir>
-
- <!-- where to generate test sources -->
- <maven.test.gen.dir>${project.build.directory}/generated-test-sources
- </maven.test.gen.dir>
-
- <!-- locales for the site generation, by default only french -->
- <maven.site.locales>fr</maven.site.locales>
-
- <!-- le fichier de license du projet -->
- <maven.license.file>${project.basedir}/LICENSE.txt</maven.license.file>
-
- <!-- to allow bad tests -->
- <maven.test.testFailureIgnore>false</maven.test.testFailureIgnore>
-
- <!-- to skip tests (can use also profile notests) -->
- <maven.test.skip>false</maven.test.skip>
-
- <!-- to control fork mode of tests -->
- <maven.test.forkMode>once</maven.test.forkMode>
-
- <!-- to activate generation of reports and javadoc when doing a site -->
- <maven.reports.generate>true</maven.reports.generate>
-
- <!-- to activate or not the generation of detail dependencies in site -->
- <maven.reports.dependencyDetailsEnabled>true
- </maven.reports.dependencyDetailsEnabled>
-
- <!-- to activate or not the generation of location detail of dependencies in site -->
- <maven.reports.dependencyLocationsEnabled>true
- </maven.reports.dependencyLocationsEnabled>
-
- <javadoc.version>2.5</javadoc.version>
-
- <!-- pour ne pas generer la javadoc -->
- <maven.javadoc.skip>false</maven.javadoc.skip>
-
- <maven.version>2.2.1</maven.version>
- <helper.version>1.2.0-SNAPSHOT</helper.version>
- <license.version>2.0.0</license.version>
- <jredmine.version>1.0.0</jredmine.version>
-
- <!-- default license to use -->
- <license.licenseName>lgpl_v3</license.licenseName>
-
- <!-- release repository url (to be used in site.xml) -->
- <repository.home.url>http://maven.nuiton.org/release
- </repository.home.url>
-
- <!-- generated changes.xml file -->
- <maven.changeFile>${maven.gen.dir}/changes/changes.xml
- </maven.changeFile>
-
<!-- test config -->
<test.redmineUrl>http://www.mynuiton.org</test.redmineUrl>
<test.redmineUsername>chemit</test.redmineUsername>
@@ -479,18 +414,6 @@
<test.verbose>false</test.verbose>
<test.encoding>UTF-8</test.encoding>
- <!-- redmine configuration -->
- <redmine.safe>false</redmine.safe>
- <redmine.url>http://www.${platform}</redmine.url>
- <redmine.projectId>jredmine</redmine.projectId>
- <redmine.xmlPath>${basedir}/target/generated-sources/changes/changes.xml
- </redmine.xmlPath>
- <redmine.issueLinkTemplate>${redmine.url}/issues/show/%ISSUE%
- </redmine.issueLinkTemplate>
- <redmine.versionLinkTemplate>${redmine.url}/versions/show/%VERSION%
- </redmine.versionLinkTemplate>
- <redmine.collectedFiles>target/collect.properties
- </redmine.collectedFiles>
</properties>
<build>
@@ -499,108 +422,25 @@
<plugins>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <executions>
- <execution>
- <id>check-project-files</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <phase>initialize</phase>
- <configuration>
- <rules>
- <requireFilesExist>
- <files>
- <file>LICENSE.txt</file>
- <file>README.txt</file>
- <file>changelog.txt</file>
- </files>
- </requireFilesExist>
- </rules>
- <ignoreCache>true</ignoreCache>
- <failFast>true</failFast>
- <fail>true</fail>
-
- </configuration>
- </execution>
- </executions>
- </plugin>
-
</plugins>
<pluginManagement>
<plugins>
<plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <encoding>${project.build.sourceEncoding}</encoding>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>${maven.compile.source}</source>
- <target>${maven.compile.target}</target>
- <encoding>${project.build.sourceEncoding}</encoding>
- </configuration>
- </plugin>
-
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
- <skip>${maven.test.skip}</skip>
- <testFailureIgnore>${maven.test.testFailureIgnore}
- </testFailureIgnore>
- <forkMode>${maven.test.forkMode}</forkMode>
<environmentVariables>
- <test.redmineUrl>${test.redmineUrl}
- </test.redmineUrl>
- <test.redmineUsername>${test.redmineUsername}
- </test.redmineUsername>
- <test.redminePassword>${test.redminePassword}
- </test.redminePassword>
+ <test.redmineUrl>${test.redmineUrl}</test.redmineUrl>
+ <test.redmineUsername>${test.redmineUsername}</test.redmineUsername>
+ <test.redminePassword>${test.redminePassword}</test.redminePassword>
<test.verbose>${test.verbose}</test.verbose>
</environmentVariables>
</configuration>
</plugin>
<plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3</version>
- <inherited>true</inherited>
-
- <configuration>
- <archive>
- <!-- cela fait bugger le chargement des service via
- ServiceLoader donc on desactive -->
- <!--index>true</index-->
- <manifest>
- <mainClass>${maven.jar.main.class}</mainClass>
- </manifest>
- <manifestEntries>
- <url>${pom.url}</url>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1</version>
- </plugin>
-
- <plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
@@ -854,61 +694,14 @@
</plugin>
<plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.0.1</version>
- <configuration>
- <inputEncoding>${project.reporting.outputEncoding}
- </inputEncoding>
- <outputEncoding>${project.reporting.outputEncoding}
- </outputEncoding>
- <generateReports>${maven.reports.generate}
- </generateReports>
- <locales>${maven.site.locales}</locales>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-release-plugin</artifactId>
- <version>2.0-beta-9</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.5.1</version>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <version>${helper.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-license-plugin</artifactId>
- <version>${license.version}</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- </plugin>
-
- <plugin>
<artifactId>maven-invoker-plugin</artifactId>
- <version>1.3</version>
+ <version>1.5</version>
</plugin>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-4</version>
- <dependencies>
- <dependency>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <version>${helper.version}</version>
- </dependency>
- </dependencies>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <version>1.2.0</version>
</plugin>
</plugins>
@@ -919,42 +712,7 @@
<reporting>
<plugins>
- <!--
- The Project Info Reports Plugin has twelve goals:
- see http://maven.apache.org/plugins/maven-project-info-reports-plugin
- -->
<plugin>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>2.1.2</version>
- <configuration>
- <dependencyDetailsEnabled>
- ${maven.reports.dependencyDetailsEnabled}
- </dependencyDetailsEnabled>
- <dependencyLocationsEnabled>
- ${maven.reports.dependencyLocationsEnabled}
- </dependencyLocationsEnabled>
- </configuration>
- <reportSets>
- <reportSet>
- <reports>
- <report>project-team</report>
- <report>mailing-list</report>
- <report>cim</report>
- <report>issue-tracking</report>
- <report>license</report>
- <report>scm</report>
- <report>dependencies</report>
- <report>dependency-convergence</report>
- <report>plugin-management</report>
- <report>plugins</report>
- <report>dependency-management</report>
- <report>summary</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
-
- <plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${javadoc.version}</version>
<configuration>
@@ -1215,211 +973,14 @@
</reportSets>
</plugin>
- <!-- changelog:changelog
- changelog:dev-activity
- changelog:file-activity -->
- <!--FIXME : TC-20090816 : there is a bug with fileactivity
- in report, trunk url are prefix with tag/xxx-releaseNumber !-->
- <plugin>
- <artifactId>maven-changelog-plugin</artifactId>
- <version>2.1</version>
- </plugin>
-
- <!-- Implicit add of reportSet to not generate jira reports -->
- <plugin>
- <artifactId>maven-changes-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <issueLinkTemplatePerSystem>
- <redmine>${redmine.issueLinkTemplate}</redmine>
- </issueLinkTemplatePerSystem>
- <xmlPath>${redmine.xmlPath}</xmlPath>
- </configuration>
- <reportSets>
- <reportSet>
- <reports>
- <report>changes-report</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <encoding>${project.reporting.outputEncoding}</encoding>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-pmd-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <linkXRef>true</linkXRef>
- <sourceEncoding>${project.reporting.outputEncoding}
- </sourceEncoding>
- <minimumTokens>100</minimumTokens>
- <targetJdk>${maven.compile.target}</targetJdk>
- </configuration>
-
- </plugin>
-
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- <version>2.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.4.3</version>
- </plugin>
-
</plugins>
</reporting>
- <!-- ************************************************************* -->
- <!-- *** Build Environment ************************************** -->
- <!-- ************************************************************* -->
-
- <!-- Build Environment : Environment Information -->
-
- <issueManagement>
- <system>redmine</system>
- <url>${redmine.url}/projects/jredmine/issues</url>
- </issueManagement>
-
- <ciManagement>
- <system>hudson</system>
- <url>http://hudson.nuiton.org/hudson/job/jredmine</url>
- </ciManagement>
-
- <distributionManagement>
- <repository>
- <id>nuiton</id>
- <url>scpexe://nuiton.org/var/lib/maven/release</url>
- </repository>
- <snapshotRepository>
- <id>nuiton</id>
- <url>scpexe://nuiton.org/var/lib/maven/snapshot</url>
- </snapshotRepository>
- <site>
- <id>nuiton</id>
- <url>
- scpexe://nuiton.org/var/lib/redmine-nuiton/project-site/jredmine
- </url>
- </site>
- </distributionManagement>
-
- <!--Any mailing lists for the project-->
- <mailingLists>
- <mailingList>
- <name>jredmine-commits</name>
- <subscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-commits
- </subscribe>
- <unsubscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-commits
- </unsubscribe>
- <post>jredmine-commits(a)list.nuiton.org</post>
- <archive>http://list.nuiton.org/pipermail/jredmine-commits/
- </archive>
- </mailingList>
-
- <mailingList>
- <name>jredmine-devel</name>
- <subscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-devel
- </subscribe>
- <unsubscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-devel
- </unsubscribe>
- <post>jredmine-devel(a)list.nuiton.org</post>
- <archive>http://list.nuiton.org/pipermail/jredmine-devel/</archive>
- </mailingList>
-
- <mailingList>
- <name>jredmine-users</name>
- <subscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-users
- </subscribe>
- <unsubscribe>
- http://list.nuiton.org/cgi-bin/mailman/listinfo/jredmine-users
- </unsubscribe>
- <post>jredmine-users(a)list.nuiton.org</post>
- <archive>http://list.nuiton.org/pipermail/jredmine-users/</archive>
- </mailingList>
- </mailingLists>
-
- <!-- Source control management. -->
- <scm>
- <connection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk
- </connection>
- <developerConnection>scm:svn:http://svn.nuiton.org/svn/jredmine/trunk
- </developerConnection>
- <url>http://www.nuiton.org/repositories/browse/jredmine/trunk</url>
- </scm>
-
<profiles>
- <profile>
- <id>release-profile</id>
- <activation>
- <property>
- <name>performRelease</name>
- <value>true</value>
- </property>
- </activation>
- <build>
- <plugins>
-
- <!-- always compute source jar -->
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <goals>
- <goal>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>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- always add license and third-party files to classpath -->
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-license-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-licenses</id>
- <goals>
- <goal>add-license</goal>
- <goal>add-third-party</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- </build>
- </profile>
-
+ <!-- TC-20100106 Due to cyclic dependency problem between modules,
+ we do not propagate maven-jredmine-plugin to child modules -->
<!-- perform only on a release stage when using the maven-release-plugin -->
- <!--profile>
+ <profile>
<id>redmine-pre-release-profile</id>
<activation>
<property>
@@ -1437,9 +998,13 @@
<plugin>
<groupId>org.nuiton.jredmine</groupId>
<artifactId>maven-jredmine-plugin</artifactId>
- <version>1.0.0-rc-2</version>
+ <version>${jredmine.version}</version>
+ <!-- TC-20100106 Due to cyclic dependency problem between modules,
+ we do not propagate maven-jredmine-plugin to child modules -->
+ <inherited>false</inherited>
<configuration>
- <columnNames>key,summary,status,assignee,tracker,priority,version,category,createdOn
+ <columnNames>
+ key,summary,status,assignee,tracker,priority,version,category,createdOn
</columnNames>
</configuration>
<reportSets>
@@ -1457,6 +1022,10 @@
<plugins>
+ <!--
+ - obtain redmine login
+ - collect files for jredmine release
+ -->
<plugin>
<groupId>org.nuiton</groupId>
<artifactId>maven-helper-plugin</artifactId>
@@ -1492,17 +1061,25 @@
</goals>
<phase>install</phase>
<configuration>
- <extraFiles />
- <descriptionFile>${redmine.collectedFiles}</descriptionFile>
+ <extraFiles>${redmine.releaseFiles}
+ </extraFiles>
+ <descriptionFile>${redmine.collectedFiles}
+ </descriptionFile>
+ <includeAttached>${redmine.includeAttached}
+ </includeAttached>
+ <!--<copyFiles>false</copyFiles>-->
</configuration>
</execution>
</executions>
</plugin>
+ <!-- generate the changes.xml from redmine -->
<plugin>
<groupId>org.nuiton.jredmine</groupId>
<artifactId>maven-jredmine-plugin</artifactId>
- <version>1.0.0-rc-2</version>
+ <!-- TC-20100106 Due to cyclic dependency problem between modules,
+ we do not propagate maven-jredmine-plugin to child modules -->
+ <inherited>false</inherited>
<executions>
<execution>
<id>jredmine-generate</id>
@@ -1516,160 +1093,26 @@
</executions>
<configuration>
+ <!-- generate-changes -->
<generateOnce>true</generateOnce>
<actionMapping>fix:1, add:2</actionMapping>
<statusIds>3,4,5</statusIds>
- <urlDownload>${redmine.url}/projects/list_files/maven-helper-plugin</urlDownload>
+ <!-- generate announcements -->
+ <urlDownload>
+ ${redmine.url}/projects/list_files/${projectId}
+ </urlDownload>
+ <!--<changesTitle>Release note of Maven pom project</changesTitle>-->
+ <!--<releaseDescription>Description of first release</releaseDescription>-->
+ <!--<verbose>true</verbose>-->
</configuration>
</plugin>
</plugins>
</build>
- </profile-->
-
- <!-- perform a redmine release after a successfull release -->
- <!--profile>
- <id>redmine-release-profile</id>
- <activation>
- <property>
- <name>performRedmineRelease</name>
- <value>true</value>
- </property>
- </activation>
-
- <properties>
- <dryRun>true</dryRun>
- <redmine.dryRun>${dryRun}</redmine.dryRun>
- </properties>
- <build>
-
- <plugins>
-
- <plugin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-helper-plugin</artifactId>
- <executions>
- <execution>
- <id>get-redmine-login</id>
- <goals>
- <goal>share-server-secret</goal>
- </goals>
- <phase>initialize</phase>
- <configuration>
- <serverId>redmine-${platform}</serverId>
- <passwordOut>redmine.password</passwordOut>
- <usernameOut>redmine.username</usernameOut>
- </configuration>
- </execution>
- <execution>
- <id>send-release-email</id>
- <goals>
- <goal>send-email</goal>
- </goals>
- <phase>validate</phase>
- </execution>
- </executions>
- <configuration>
-
- <runOnce>true</runOnce>
-
- <emailTitle>[ANNOUNCEMENT] - ${project.name} ${project.version} released</emailTitle>
- <emailContentFile>target/generated-sources/announcement/release-email-announcement.vm
- </emailContentFile>
- <mailSender>
- <name>${platform} Release Notification</name>
- <email>noreply@${platform}</email>
- </mailSender>
- <toAddresses>
- <item>${listId}-users(a)list.${platform}</item>
- <item>${listId}-devel(a)list.${platform}</item>
- <item>dev(a)codelutin.com</item>
- </toAddresses>
- <smtpHost>smtp</smtpHost>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.nuiton.jredmine</groupId>
- <artifactId>maven-jredmine-plugin</artifactId>
- <version>1.0.0-rc-2</version>
- <executions>
- <execution>
- <id>jredmine-release</id>
- <goals>
- <goal>update-version</goal>
- <goal>publish-attachments</goal>
- <goal>publish-news</goal>
- </goals>
- <phase>validate</phase>
- </execution>
- </executions>
- <configuration>
-
- <runOnce>true</runOnce>
-
- <closeVersion>true</closeVersion>
-
- <filesFromProperties>${redmine.collectedFiles}</filesFromProperties>
-
- <newsContentFile>target/generated-sources/announcement/release-news-announcement.vm
- </newsContentFile>
- <newsSummary>${project.description}</newsSummary>
- <newsTitle>${project.name} ${project.version} released</newsTitle>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
- </profile-->
-
- <!-- do not execute tests (generaly a bad idea...) -->
- <profile>
- <id>notests</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- </properties>
</profile>
- <!-- do not build reports (speedup site generation in dev) -->
- <profile>
- <id>noreports</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <maven.reports.generate>false</maven.reports.generate>
- </properties>
- </profile>
- <!-- do not build dependencies detail in maven-project-info-report (speedup site generation in dev) -->
- <profile>
- <id>nodepdetails</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <maven.reports.dependencyDetailsEnabled>false
- </maven.reports.dependencyDetailsEnabled>
- </properties>
- </profile>
- <!-- do not build locations of dependencies in maven-project-info-report (speedup site generation in dev) -->
- <profile>
- <id>nodeplocations</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <properties>
- <maven.reports.dependencyLocationsEnabled>false
- </maven.reports.dependencyLocationsEnabled>
- </properties>
- </profile>
-
</profiles>
</project>
Deleted: trunk/src/site/site.xml
===================================================================
--- trunk/src/site/site.xml 2010-01-04 16:11:59 UTC (rev 68)
+++ trunk/src/site/site.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="${project.name}">
-
- <publishDate format="dd/MM/yyyy"/>
-
- <skin>
- <groupId>org.nuiton</groupId>
- <artifactId>maven-nuiton-skin</artifactId>
- <version>1.0.0</version>
- </skin>
- <bannerLeft>
- <name>${project.name}</name>
- <href>index.html</href>
- </bannerLeft>
-
- <bannerRight>
- <src>http://www.codelutin.com/images/lutinorange-codelutin.png</src>
- <href>${project.organization.url}</href>
- </bannerRight>
-
- <poweredBy>
- <logo href="http://maven.apache.org" name="Maven" img="${project.url}/images/logos/maven-feather.png"/>
- </poweredBy>
-
- <body>
-
- <links>
- <item name="Chorem" href="http://www.chorem.org"/>
- <item name="Nuiton" href="http://www.nuiton.org"/>
- <item name="Labs" href="http://labs.libre-entreprise.org/"/>
- <item name="${project.organization.name}" href="${project.organization.url}"/>
- <item name="dépôt maven" href="${repository.home.url}"/>
- </links>
-
- <breadcrumbs>
- <item name="${project.name}" href="${project.url}"/>
- </breadcrumbs>
-
- <menu name="Utilisateur">
- <item name="Introduction" href="index.html"/>
- </menu>
-
- <menu name="Développeur">
- <item name="Todo" href="todo.html"/>
- </menu>
-
- <menu ref="modules"/>
-
- <menu ref="reports"/>
-
- </body>
-</project>
Copied: trunk/src/site/site_fr.xml (from rev 67, trunk/src/site/site.xml)
===================================================================
--- trunk/src/site/site_fr.xml (rev 0)
+++ trunk/src/site/site_fr.xml 2010-01-06 23:55:31 UTC (rev 69)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="${project.name}">
+
+ <bannerLeft>
+ <name>${project.name}</name>
+ <href>index.html</href>
+ </bannerLeft>
+
+ <poweredBy>
+ <logo href="http://maven.apache.org" name="Maven" img="${project.url}/images/logos/maven-feather.png"/>
+ </poweredBy>
+
+ <body>
+
+ <breadcrumbs>
+ <item name="${project.name}" href="index.html"/>
+ </breadcrumbs>
+
+ <menu name="Utilisateur">
+ <item name="Introduction" href="index.html"/>
+ </menu>
+
+ <menu name="Développeur">
+ <item name="Todo" href="todo.html"/>
+ </menu>
+
+ <menu ref="modules"/>
+
+ <menu ref="reports"/>
+
+ </body>
+</project>
1
0
r68 - trunk/jredmine-client/src/main/java/org/nuiton/jredmine
by tchemit@users.nuiton.org 04 Jan '10
by tchemit@users.nuiton.org 04 Jan '10
04 Jan '10
Author: tchemit
Date: 2010-01-04 17:11:59 +0100 (Mon, 04 Jan 2010)
New Revision: 68
Modified:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
Log:
add comment
fix javadoc
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java 2010-01-03 11:52:48 UTC (rev 67)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java 2010-01-04 16:11:59 UTC (rev 68)
@@ -100,6 +100,7 @@
}
}
} finally {
+ // can't remove the reference since plexus injects it
// if (session != null) {
// session = null;
// }
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2010-01-03 11:52:48 UTC (rev 67)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2010-01-04 16:11:59 UTC (rev 68)
@@ -21,7 +21,7 @@
package org.nuiton.jredmine;
/**
- * The full service with anonymous methods and loggued ones.
+ * The full redmine service with anonymous and loggued methods.
* <p/>
* <b>Note:</b> A default implementation is offered :
* {@link DefaultRedmineService}
1
0
Author: tchemit
Date: 2010-01-03 12:52:48 +0100 (Sun, 03 Jan 2010)
New Revision: 67
Added:
trunk/jredmine-client/src/site/apt/redmine_service.apt
Modified:
trunk/jredmine-client/src/site/apt/index.apt
trunk/jredmine-client/src/site/site.xml
Log:
update documentation
Modified: trunk/jredmine-client/src/site/apt/index.apt
===================================================================
--- trunk/jredmine-client/src/site/apt/index.apt 2010-01-03 10:49:37 UTC (rev 66)
+++ trunk/jredmine-client/src/site/apt/index.apt 2010-01-03 11:52:48 UTC (rev 67)
@@ -109,17 +109,5 @@
Le client java qui interroge le plugin rails se base sur l'api du plugin rails
et transforme les données retournées en xml en objets java.
- La classe à utiliser est la suivante
-
---------------------------------------------------------------------------------
-org.nuiton.jredmine.DefaultRedmineService
---------------------------------------------------------------------------------
-
- qui réalise le contrat
-
---------------------------------------------------------------------------------
-org.nuiton.jredmine.RedmineService
---------------------------------------------------------------------------------
-
-
- <Pour plus de détails, consulter la javadoc du module.>
\ No newline at end of file
+ La {{{redmine_service.html}page suivante}} détaille les services disponibles
+ en java.
Added: trunk/jredmine-client/src/site/apt/redmine_service.apt
===================================================================
--- trunk/jredmine-client/src/site/apt/redmine_service.apt (rev 0)
+++ trunk/jredmine-client/src/site/apt/redmine_service.apt 2010-01-03 11:52:48 UTC (rev 67)
@@ -0,0 +1,47 @@
+----
+RedmineService
+----
+----
+2009-09-15
+----
+
+Les contrats de service
+
+ L'api java sépare depuis la version 1.0.3 les services publiques et privés.
+
+* org.nuiton.jredmine.RedmineAnonymousService
+
+ Ce contrat permet d'exécuter les services publiques (services anonymes).
+
+* org.nuiton.jredmine.RedmineLogguedService
+
+ Ce contrat permet d'exécuter les services privés (services avec login).
+
+* org.nuiton.jredmine.RedmineService
+
+ Ce contrat regroupe les deux précédents et constitue l'ensemble des services
+ connus par redmine.
+
+
+Les implentations de service
+
+ L'api offre deux implentations de service.
+
+* org.nuiton.jredmine.DefaultRedmineAnonymousService
+
+ Ce service peut-être appelé pour tout opération publique, la session
+ sous-jacente au service (RedmineRestClient) n'établiera pas d'authentification
+ vers les serveur redmine.
+
+* org.nuiton.jredmine.DefaultRedmineService
+
+ Ce service peut-être appelé pour toute opération vers le serveur redmine.
+
+ Si la configuration requièrt un login (propriété anonymous à false), une
+ authentification sera effectuée.
+
+ A noter que si on utilise ce service en anonyme et que l'on tente d'appeler
+ une méthode de service privé, une exception sera remontée indiquant qu'il faut
+ être authentifié pour effectuer cette opération.
+
+ <Pour plus de détails, consulter la javadoc du module.>
Modified: trunk/jredmine-client/src/site/site.xml
===================================================================
--- trunk/jredmine-client/src/site/site.xml 2010-01-03 10:49:37 UTC (rev 66)
+++ trunk/jredmine-client/src/site/site.xml 2010-01-03 11:52:48 UTC (rev 67)
@@ -17,6 +17,7 @@
<menu name="Utilisateur">
<item name="Introduction" href="index.html"/>
<item name="JRedmine rails API" href="rails_api.html"/>
+ <item name="JRedmine java service" href="redmine_service.html"/>
</menu>
<menu name="Développeur">
1
0
Author: tchemit
Date: 2010-01-03 11:49:37 +0100 (Sun, 03 Jan 2010)
New Revision: 66
Added:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java
trunk/maven-jredmine-plugin/src/test/resources/log4j.properties
trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
Modified:
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java
trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
trunk/jredmine-client/src/test/resources/log4j.properties
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java
trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
Log:
Evolution #127: Pouvoir acc?\195?\169der a certains services sans ?\195?\170tre connect?\195?\169 :
- creation de deux contracts pour separer l'api publique et privee
- amelioration du design des services
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineAnonymousService.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,197 @@
+package org.nuiton.jredmine;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.jredmine.model.*;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Default implementation of {@link RedmineAnonymousService}.
+ * <p/>
+ * This implementation just make sure that the rest client is anonnymous.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author chemit
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision: $
+ * <p/>
+ * Mise a jour: $Date: $ par :
+ * $Author: tchemit $
+ * @plexus.component role="org.nuiton.jredmine.RedmineAnonymousService" role-hint="default"
+ * @see org.nuiton.io.rest.RestClientConfiguration#isAnonymous()
+ * @since 1.0.3
+ */
+public class DefaultRedmineAnonymousService implements RedmineServiceImplementor, RedmineAnonymousService {
+ /**
+ * Logger
+ */
+ private static final Log log = LogFactory.getLog(DefaultRedmineAnonymousService.class);
+ //FIXME Make this works again (there is a bad internal state somewhere...)
+// /**
+// * @plexus.requirement role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="default"
+// */
+ protected RedmineServiceImplementor delegateImplementor;
+
+ public DefaultRedmineAnonymousService() {
+ delegateImplementor = new DefaultRedmineServiceImplementor();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineAnonymousService implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ISSUE_STATUS_LIST, IssueStatus.class);
+ }
+
+ @Override
+ public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ISSUE_PRIORITY_LIST, IssuePriority.class);
+ }
+
+ @Override
+ public Project[] getProjects() throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_PROJECT_LIST, Project.class);
+ }
+
+ @Override
+ public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ISSUE_CATEGORY_LIST, IssueCategory.class, projectName);
+ }
+
+ @Override
+ public Project getProject(String projectName) throws RedmineServiceException {
+ return getData(RedmineRestClient.GET_PROJECT, Project.class, projectName);
+ }
+
+ @Override
+ public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_TRACKER_LIST, Tracker.class, projectName);
+ }
+
+ @Override
+ public News[] getNews(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_NEWS_LIST, News.class, projectName);
+ }
+
+ @Override
+ public User[] getUsers(String projectName) throws RedmineServiceException {
+ return getProjectMembers(projectName);
+ }
+
+ @Override
+ public User[] getProjectMembers(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_USER_LIST, User.class, projectName);
+ }
+
+ @Override
+ public Version[] getVersions(String projectName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_VERSION_LIST, Version.class, projectName);
+ }
+
+ @Override
+ public Version getVersion(String projectName, String versionName) throws RedmineServiceException {
+ return getData(RedmineRestClient.GET_VERSION, Version.class, projectName, versionName);
+ }
+
+ @Override
+ public Attachment[] getAttachments(String projectName, String versionName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ATTACHMENTS_LIST, Attachment.class, projectName, versionName);
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName, String versionName) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ISSUE_LIST, Issue.class, projectName, versionName);
+ }
+
+ @Override
+ public TimeEntry[] getIssueTimeEntries(String projectName, String issueId) throws RedmineServiceException {
+ return getDatas(RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST, TimeEntry.class, projectName, issueId);
+ }
+
+ @Override
+ public Issue[] getIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_ISSUES, Issue.class, projectName);
+ return result;
+ }
+
+ @Override
+ public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_OPENED_ISSUES, Issue.class, projectName);
+ return result;
+ }
+
+ @Override
+ public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
+ Issue[] result = getDatas(RedmineRestClient.GET_PROJECT_CLOSED_ISSUES, Issue.class, projectName);
+ return result;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+ @Override
+ public RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException {
+ // Force to not be loggued
+ configuration.setAnonymous(true);
+ if (log.isDebugEnabled()) {
+ log.debug("init configuration for " + this);
+ }
+ RedmineServiceImplementor result = delegateImplementor.init(configuration);
+ return result;
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
+ if (log.isDebugEnabled()) {
+ log.debug("init session for " + this);
+ }
+ checkNotLoggued(session);
+ return delegateImplementor.init(session);
+ }
+
+ @Override
+ public <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException {
+ return delegateImplementor.getData(requestName, type, args);
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException {
+ return delegateImplementor.getDatas(requestName, type, args);
+ }
+
+ @Override
+ public <T> T sendData(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendData(requestName, klazz, args);
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException {
+ return delegateImplementor.sendDatas(requestName, klazz, args);
+ }
+
+ @Override
+ public boolean isInit() {
+ return delegateImplementor.isInit();
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ delegateImplementor.destroy();
+ }
+
+ @Override
+ public void checkNotLoggued(RestClient session) throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkNotLoggued(session);
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ delegateImplementor.checkLoggued();
+ }
+
+}
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineService.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -22,18 +22,11 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.nuiton.io.rest.RestClient;
import org.nuiton.io.rest.RestClientConfiguration;
-import org.nuiton.io.rest.RestException;
-import org.nuiton.io.rest.RestRequest;
import org.nuiton.jredmine.model.*;
-import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
import org.nuiton.jredmine.rest.RedmineRestClient;
-import java.io.IOException;
-import java.io.InputStream;
-
/**
* Default {@link RedmineService} implementation based on a {@link RestClient}
*
@@ -41,437 +34,74 @@
* @plexus.component role="org.nuiton.jredmine.RedmineService" role-hint="default"
* @since 1.0.0
*/
-public class DefaultRedmineService implements RedmineService, RedmineServiceImplementor {
+public class DefaultRedmineService extends DefaultRedmineAnonymousService implements RedmineService {
protected static final Log log = LogFactory.getLog(DefaultRedmineService.class);
- /**
- * client Rest
- *
- * @plexus.requirement role="org.nuiton.io.rest.RestClient"
- * role-hint="redmine"
- */
- protected RestClient session;
- /**
- * xpp3 xpp3Helper to transform xml stream to pojo
- */
- protected final RedmineXpp3Helper xpp3Helper;
- /**
- * internal state to known if service was init
- */
- protected boolean init;
- public DefaultRedmineService() {
- this.xpp3Helper = new RedmineXpp3Helper();
- if (log.isDebugEnabled()) {
- log.debug("new " + this);
- }
- }
-
///////////////////////////////////////////////////////////////////////////
- /// RedmineService implementation
+ /// RedmineServiceImplementor implementation
///////////////////////////////////////////////////////////////////////////
@Override
- public Version addVersion(String projectName, Version version) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.ADD_VERSION, projectName, version);
-
- // send data and obtain created version
- try {
-
- InputStream stream = session.sendData(r);
- Version v = getDataFromStream(Version.class, stream);
- return v;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
+ public RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException {
+ RedmineServiceImplementor result = delegateImplementor.init(configuration);
+ return result;
}
@Override
- public Attachment addAttachment(String projectName, String versionName, Attachment attachement) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.ADD_ATTACHMENT, projectName, versionName, attachement);
+ public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
+ return delegateImplementor.init(session);
+ }
- // send data and obtain created attachment
- try {
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineLogguedService implementation
+ ///////////////////////////////////////////////////////////////////////////
- InputStream stream = session.sendData(r);
- Attachment v = getDataFromStream(Attachment.class, stream);
- return v;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
+ @Override
+ public Project[] getUserProjects() throws RedmineServiceException {
+ checkLoggued();
+ Project[] result = getDatas(RedmineRestClient.GET_USER_PROJECTS, Project.class);
+ return result;
}
@Override
- public News addNews(String projectName, News news) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.ADD_NEWS, projectName, news);
-
- // send data and obtain created news
- try {
-
- InputStream stream = session.sendData(r);
- News v = getDataFromStream(News.class, stream);
- return v;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
+ public Version addVersion(String projectName, Version version) throws RedmineServiceException {
+ // send data and obtain created version
+ Version result = sendData(RedmineRestClient.ADD_VERSION, Version.class, projectName, version);
+ return result;
}
@Override
public Version updateVersion(String projectName, Version version) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.UPDATE_VERSION, projectName, version);
-
// send data and obtain updated version
- try {
-
- InputStream stream = session.sendData(r);
- Version v = getDataFromStream(Version.class, stream);
- return v;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
+ Version result = sendData(RedmineRestClient.UPDATE_VERSION, Version.class, projectName, version);
+ return result;
}
@Override
public Version nextVersion(String projectName, String oldVersionName, Version newVersion) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.NEXT_VERSION, projectName, oldVersionName, newVersion);
// send data and obtain updated version
- try {
-
- InputStream stream = session.sendData(r);
- Version v = getDataFromStream(Version.class, stream);
- return v;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
+ Version result = sendData(RedmineRestClient.NEXT_VERSION, Version.class, projectName, oldVersionName, newVersion);
+ return result;
}
@Override
- public TimeEntry addIssueTimeEntry(String projectName, String issueId, TimeEntry entry) throws RedmineServiceException {
- checkInit();
- RestRequest r = getRequest(RedmineRestClient.ADD_ISSUE_TIME_ENTRY, projectName, issueId, entry);
-
- // send data and obtain updated version
- try {
-
- InputStream stream = session.sendData(r);
- TimeEntry timeEntry = getDataFromStream(TimeEntry.class, stream);
- return timeEntry;
- } catch (Exception e) {
- throw new RedmineServiceException("could not send for reason " + e.getMessage(), e);
- }
- }
-
- @Override
- public IssueStatus[] getIssueStatuses() throws RedmineServiceException {
- return getDatas(IssueStatus.class);
- }
-
- @Override
- public IssuePriority[] getIssuePriorities() throws RedmineServiceException {
- return getDatas(IssuePriority.class);
- }
-
- @Override
- public Project[] getProjects() throws RedmineServiceException {
- return getDatas(Project.class);
- }
-
- @Override
- public IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException {
- return getDatas(IssueCategory.class, projectName);
- }
-
- @Override
- public Project getProject(String projectName) throws RedmineServiceException {
- return getData(Project.class, projectName);
- }
-
- @Override
- public Tracker[] getTrackers(String projectName) throws RedmineServiceException {
- return getDatas(Tracker.class, projectName);
- }
-
- @Override
- public News[] getNews(String projectName) throws RedmineServiceException {
- return getDatas(News.class, projectName);
- }
-
- @Override
- public User[] getUsers(String projectName) throws RedmineServiceException {
- return getDatas(User.class, projectName);
- }
-
- @Override
- public Version[] getVersions(String projectName) throws RedmineServiceException {
- return getDatas(Version.class, projectName);
- }
-
- @Override
- public Version getVersion(String projectName, String versionName) throws RedmineServiceException {
- return getData(Version.class, projectName, versionName);
- }
-
- @Override
- public Attachment[] getAttachments(String projectName, String versionName) throws RedmineServiceException {
- return getDatas(Attachment.class, projectName, versionName);
- }
-
- @Override
- public Issue[] getIssues(String projectName, String versionName) throws RedmineServiceException {
- return getDatas(Issue.class, projectName, versionName);
- }
-
- @Override
- public TimeEntry[] getIssueTimeEntries(String projectName, String issueId) throws RedmineServiceException {
- return getDatas(TimeEntry.class, projectName, issueId);
- }
-
- @Override
- public Project[] getUserProjects() throws RedmineServiceException {
-
- Class<Project> type = Project.class;
- RestRequest r = getRequest(RedmineRestClient.GET_USER_PROJECTS);
-
- // obtain data from rest client
- InputStream stream;
- try {
-
- stream = session.askData(r);
-
- } catch (Exception e) {
- throw new RedmineServiceException("could not obtain data stream for type " + type.getName() + "forUser for reason " + e.getMessage(), e);
- }
-
- if (stream == null) {
- return null;
- }
- Project[] projects = getDatasFromStream(type, stream);
- return projects;
- }
-
- @Override
- public Issue[] getIssues(String projectName) throws RedmineServiceException {
- Class<Issue> type = Issue.class;
- RestRequest r = getRequest(RedmineRestClient.GET_PROJECT_ISSUES, projectName);
-
- // obtain data from rest client
- InputStream stream;
- try {
-
- stream = session.askData(r);
-
- } catch (Exception e) {
- throw new RedmineServiceException("could not obtain data stream for type " + r + " for reason " + e.getMessage(), e);
- }
-
- if (stream == null) {
- return null;
- }
- Issue[] issues = getDatasFromStream(type, stream);
- return issues;
- }
-
- @Override
- public Issue[] getOpenedIssues(String projectName) throws RedmineServiceException {
- Class<Issue> type = Issue.class;
- RestRequest r = getRequest(RedmineRestClient.GET_PROJECT_OPENED_ISSUES, projectName);
-
- // obtain data from rest client
- InputStream stream;
- try {
-
- stream = session.askData(r);
-
- } catch (Exception e) {
- throw new RedmineServiceException("could not obtain data stream for type " + type.getName() + "forUser for reason " + e.getMessage(), e);
- }
-
- if (stream == null) {
- return null;
- }
- Issue[] issues = getDatasFromStream(type, stream);
- return issues;
- }
-
- @Override
- public Issue[] getClosedIssues(String projectName) throws RedmineServiceException {
- Class<Issue> type = Issue.class;
- RestRequest r = getRequest(RedmineRestClient.GET_PROJECT_CLOSED_ISSUES, projectName);
-
- // obtain data from rest client
- InputStream stream;
- try {
-
- stream = session.askData(r);
-
- } catch (Exception e) {
- throw new RedmineServiceException("could not obtain data stream for type " + type.getName() + "forUser for reason " + e.getMessage(), e);
- }
-
- if (stream == null) {
- return null;
- }
- Issue[] issues = getDatasFromStream(type, stream);
- return issues;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// RedmineServiceImplementor implementation
- ///////////////////////////////////////////////////////////////////////////
- @Override
- public boolean isInit() {
- return init;
- }
-
- @Override
- public RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException {
- session.setConfiguration(configuration);
- RedmineServiceImplementor result = init(session);
+ public Attachment addAttachment(String projectName, String versionName, Attachment attachement) throws RedmineServiceException {
+ // send data and obtain created attachment
+ Attachment result = sendData(RedmineRestClient.ADD_ATTACHMENT, Attachment.class, projectName, versionName, attachement);
return result;
}
@Override
- public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
- if (init) {
- throw new IllegalStateException("the client " + this + " was already init!");
- }
- try {
- this.session = session;
-
- if (!session.isOpen()) {
- session.open();
- }
-
- init = true;
- } catch (Exception e) {
- throw new RedmineServiceException("could not init service for reason " + e.getMessage(), e);
- }
- return this;
- }
-
- @Override
- public void destroy() throws RedmineServiceException {
- checkInit();
- try {
- if (session.isOpen()) {
- try {
- session.close();
- } catch (RestException ex) {
- throw new RedmineServiceException("has problem while closing Rest client " + ex.getMessage(), ex);
- }
- }
- } finally {
- if (session != null) {
- session = null;
- }
- init = false;
- }
- }
-
- @Override
- public <T> T getData(Class<T> type, Object... args) throws RedmineServiceException {
- checkInit();
-
- InputStream stream = getDataStream(type, args);
-
- if (stream == null) {
- return null;
- }
-
- T result = getDataFromStream(type, stream);
+ public News addNews(String projectName, News news) throws RedmineServiceException {
+ // send data and obtain created news
+ News result = sendData(RedmineRestClient.ADD_NEWS, News.class, projectName, news);
return result;
}
@Override
- public <T> T[] getDatas(Class<T> type, Object... args) throws RedmineServiceException {
- checkInit();
-
- InputStream stream = getDatasStream(type, args);
-
- if (stream == null) {
- return null;
- }
-
- T[] result = getDatasFromStream(type, stream);
+ public TimeEntry addIssueTimeEntry(String projectName, String issueId, TimeEntry entry) throws RedmineServiceException {
+ // send data and obtain updated version
+ TimeEntry result = sendData(RedmineRestClient.ADD_ISSUE_TIME_ENTRY, TimeEntry.class, projectName, issueId, entry);
return result;
}
-
- @Override
- public <T> InputStream getDataStream(Class<T> type, Object... args) throws RedmineServiceException {
-
- InputStream stream = getDataStream(type, false, args);
- return stream;
- }
-
- @Override
- public <T> InputStream getDatasStream(Class<T> type, Object... args) throws RedmineServiceException {
-
- InputStream stream = getDataStream(type, true, args);
- return stream;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- /// Internal methods
- ///////////////////////////////////////////////////////////////////////////
- protected <T> InputStream getDataStream(Class<T> type, boolean array, Object... args) throws RedmineServiceException {
-
- String requestName = type.getName() + (array ? "list" : "detail");
- RestRequest r = getRequest(requestName, args);
-
- // obtain data from rest client
- try {
-
- InputStream stream = session.askData(r);
- return stream;
- } catch (Exception e) {
- throw new RedmineServiceException("could not botain data stream for type " + type + " for reason " + e.getMessage(), e);
- }
- }
-
- protected RestRequest getRequest(String requestName, Object... args) throws RedmineServiceException {
- RestRequest r;
- try {
- r = session.getRequest(requestName, args);
- } catch (Exception e) {
- throw new RedmineServiceException("could not find the request named " + requestName + " for reason " + e.getMessage(), e);
- }
- if (r == null) {
- throw new RedmineServiceException("could not find the request named " + requestName);
- }
- return r;
- }
-
- protected <T> T getDataFromStream(Class<T> type, InputStream stream) throws RedmineServiceException {
-
- try {
- T result = xpp3Helper.readObject(type, stream);
- return result;
- } catch (IOException ex) {
- throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
- } catch (XmlPullParserException ex) {
- throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
- }
- }
-
- protected <T> T[] getDatasFromStream(Class<T> type, InputStream stream) throws RedmineServiceException {
-
- try {
- T[] result = xpp3Helper.readObjects(type, stream);
- return result;
- } catch (IOException ex) {
- throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
- } catch (XmlPullParserException ex) {
- throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
- }
- }
-
- protected void checkInit() throws IllegalStateException {
- if (!init) {
- throw new IllegalStateException("the client " + this + " is not init!");
- }
- }
-}
+}
\ No newline at end of file
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,249 @@
+package org.nuiton.jredmine;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.nuiton.io.rest.RestClient;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.io.rest.RestException;
+import org.nuiton.io.rest.RestRequest;
+import org.nuiton.jredmine.model.io.xpp3.RedmineXpp3Helper;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ * @plexus.component role="org.nuiton.jredmine.RedmineServiceImplementor" role-hint="default"
+ * @since 1.0.3
+ */
+public class DefaultRedmineServiceImplementor implements RedmineServiceImplementor {
+ /**
+ * Logger
+ */
+ private static final Log log = LogFactory.getLog(DefaultRedmineServiceImplementor.class);
+ //FIXME Make this works again (there is a bad internal state somewhere...)
+// /**
+// * client Rest
+// *
+// * @plexus.requirement role="org.nuiton.io.rest.RestClient" role-hint="redmine"
+// */
+ protected RestClient session;
+ /**
+ * xpp3 xpp3Helper to transform xml stream to pojo
+ */
+ protected final RedmineXpp3Helper xpp3Helper;
+ /**
+ * internal state to known if service was init
+ */
+ protected boolean init;
+
+ public DefaultRedmineServiceImplementor() {
+ this.xpp3Helper = new RedmineXpp3Helper();
+ if (log.isDebugEnabled()) {
+ log.debug("new " + this);
+ }
+ this.session = new RedmineRestClient();
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ /// RedmineServiceImplementor implementation
+ ///////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public boolean isInit() {
+ return init;
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RestClientConfiguration configuration) throws RedmineServiceException {
+ session.setConfiguration(configuration);
+ RedmineServiceImplementor result = init(session);
+ return result;
+ }
+
+ @Override
+ public RedmineServiceImplementor init(RestClient session) throws RedmineServiceException {
+ if (init) {
+ throw new IllegalStateException("the client " + this + " was already init!");
+ }
+ try {
+ this.session = session;
+
+ if (!session.isOpen()) {
+ session.open();
+ }
+
+ init = true;
+ } catch (Exception e) {
+ throw new RedmineServiceException("could not init service for reason " + e.getMessage(), e);
+ }
+ return this;
+ }
+
+ @Override
+ public void destroy() throws RedmineServiceException {
+ checkInit();
+ try {
+ if (session.isOpen()) {
+ try {
+ session.close();
+ } catch (RestException ex) {
+ throw new RedmineServiceException("has problem while closing Rest client " + ex.getMessage(), ex);
+ }
+ }
+ } finally {
+// if (session != null) {
+// session = null;
+// }
+ init = false;
+ }
+ }
+
+ @Override
+ public <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T result = getDataFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException {
+ checkInit();
+ InputStream stream = askDataStream(requestName, args);
+ T[] result = getDatasFromStream(type, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T sendData(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T result = getDataFromStream(klazz, stream);
+ return result;
+ }
+
+ @Override
+ public <T> T[] sendDatas(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException {
+ checkLoggued();
+ InputStream stream = sendDataStream(requestName, args);
+ T[] result = getDatasFromStream(klazz, stream);
+ return result;
+ }
+
+ @Override
+ public void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException {
+ checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException("can not access this service in anonymous mode");
+ }
+ }
+
+ @Override
+ public void checkNotLoggued(RestClient session) throws RedmineServiceLoginException, NullPointerException {
+// checkInit();
+ checkSessionNotNull(session);
+ checkSessionConfigurationNotNull(session);
+ if (!session.getConfiguration().isAnonymous()) {
+ throw new RedmineServiceLoginException("session must be anonymous in this service");
+ }
+ }
+
+ protected InputStream askDataStream(String requestName, Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.askData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException("could not obtain data stream for request " + requestName + " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected InputStream sendDataStream(String requestName, Object... args) throws RedmineServiceException {
+
+ RestRequest r = getRequest(requestName, args);
+
+ // obtain data from rest client
+ try {
+
+ InputStream stream = session.sendData(r);
+ return stream;
+ } catch (Exception e) {
+ throw new RedmineServiceException("could not send data stream for request " + requestName + " for reason " + e.getMessage(), e);
+ }
+ }
+
+ protected RestRequest getRequest(String requestName, Object... args) throws RedmineServiceException {
+ RestRequest r;
+ try {
+ r = session.getRequest(requestName, args);
+ } catch (Exception e) {
+ throw new RedmineServiceException("could not find the request named " + requestName + " for reason " + e.getMessage(), e);
+ }
+ if (r == null) {
+ throw new RedmineServiceException("could not find the request named " + requestName);
+ }
+ return r;
+ }
+
+ protected <T> T getDataFromStream(Class<T> type, InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+
+ try {
+ T result = xpp3Helper.readObject(type, stream);
+ return result;
+ } catch (IOException ex) {
+ throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
+ } catch (XmlPullParserException ex) {
+ throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ protected <T> T[] getDatasFromStream(Class<T> type, InputStream stream) throws RedmineServiceException {
+ if (stream == null) {
+ return null;
+ }
+ try {
+ T[] result = xpp3Helper.readObjects(type, stream);
+ return result;
+ } catch (IOException ex) {
+ throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
+ } catch (XmlPullParserException ex) {
+ throw new RedmineServiceException("could not obtain datas of type " + type + " for reason " + ex.getMessage(), ex);
+ }
+ }
+
+ protected void checkInit() throws IllegalStateException {
+ if (!init) {
+ throw new IllegalStateException("the client " + this + " is not init!");
+ }
+ }
+
+ protected void checkSessionNotNull(RestClient session) {
+ if (session == null) {
+ throw new NullPointerException("session can not be null");
+ }
+ }
+
+ protected void checkSessionConfigurationNotNull(RestClient session) {
+ if (session.getConfiguration() == null) {
+ throw new NullPointerException("session configuration can not be null");
+ }
+ }
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/DefaultRedmineServiceImplementor.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,202 @@
+package org.nuiton.jredmine;
+
+import org.nuiton.jredmine.model.*;
+
+/**
+ * Contract of all redmine operations which do not requires any login to server.
+ * <p/>
+ * A default implementation is offered in
+ * {@link org.nuiton.jredmine.DefaultRedmineAnonymousService}.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ * @see org.nuiton.jredmine.DefaultRedmineAnonymousService
+ * @since 1.0.3
+ */
+public interface RedmineAnonymousService {
+
+ /**
+ * Obtain all accessible projets.
+ *
+ * @return all the projects
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.Project
+ */
+ Project[] getProjects() throws RedmineServiceException;
+
+ /**
+ * Obtain all the priorities defined on a {@link org.nuiton.jredmine.model.Issue}.
+ * <p/>
+ * <b>Note : </b> The priorities are common for all projects.
+ *
+ * @return all the issue properties
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.IssuePriority
+ */
+ IssuePriority[] getIssuePriorities() throws RedmineServiceException;
+
+ /**
+ * Obtain all the statuses defined on a {@link org.nuiton.jredmine.model.Issue}.
+ * <p/>
+ * <b>Note : </b> The statuses are common for all projects.
+ *
+ * @return all the issue statuses
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.IssueStatus
+ */
+ IssueStatus[] getIssueStatuses() throws RedmineServiceException;
+
+ /**
+ * Obtain a project given his name.
+ *
+ * @param projectName the name of the project
+ * @return the project
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Project
+ */
+ Project getProject(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all categories defined on issues for a given project.
+ *
+ * @param projectName the name of the project
+ * @return the categories of issues for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.IssueCategory
+ */
+ IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all trackers defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the trackers for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.Tracker
+ */
+ Tracker[] getTrackers(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all news defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the news for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see News
+ */
+ News[] getNews(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all users defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the users for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see User
+ * @deprecated since 1.0.3, use now {@link #getProjectMembers(String)}.
+ */
+ @Deprecated
+ User[] getUsers(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all users defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the users for the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see User
+ */
+ User[] getProjectMembers(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all versions defined on a given project.
+ *
+ * @param projectName the name of the project
+ * @return the versions of the given project.
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Version
+ */
+ Version[] getVersions(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain a specific version for a given project.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the version
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Version
+ */
+ Version getVersion(String projectName, String versionName) throws RedmineServiceException;
+
+ /**
+ * Obtain all issues for a given project
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all opened issues for a given project
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getOpenedIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all closed issues for a given project
+ *
+ * @param projectName the name of the project
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ * @since 1.0.3
+ */
+ Issue[] getClosedIssues(String projectName) throws RedmineServiceException;
+
+ /**
+ * Obtain all issues for a specific version on a given project
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the issues
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Issue
+ */
+ Issue[] getIssues(String projectName, String versionName) throws RedmineServiceException;
+
+ /**
+ * Obtain for a given issue of a given project all the time entries.
+ *
+ * @param projectName the name of the project
+ * @param issueId the id of the issue
+ * @return the time entries of the issue
+ * @throws RedmineServiceException if any pb while retrieving time entries of the issue
+ * @since 1.0.3
+ */
+ TimeEntry[] getIssueTimeEntries(String projectName, String issueId) throws RedmineServiceException;
+
+ /**
+ * Obtain all attachments for a specific version on a given project
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @return the attachments
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see Attachment
+ */
+ Attachment[] getAttachments(String projectName, String versionName) throws RedmineServiceException;
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineAnonymousService.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,123 @@
+package org.nuiton.jredmine;
+
+import org.nuiton.jredmine.model.*;
+
+
+/**
+ * Contract of all redmine operations that needs a login to be performed.
+ * <p/>
+ * A default implementation is offered in
+ * {@link org.nuiton.jredmine.DefaultRedmineService}.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ * @see RedmineAnonymousService
+ * @see RedmineService
+ * @since 1.0.3
+ */
+public interface RedmineLogguedService {
+
+ /**
+ * Obtain for the loggued user, all projets where he belongs.
+ * <p/>
+ * <b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @return all the projects belonged by the loggued user
+ * @throws RedmineServiceException if any pb while retriving datas
+ * @see org.nuiton.jredmine.model.Project
+ * @since 1.0.3
+ */
+ Project[] getUserProjects() throws RedmineServiceException;
+
+ /**
+ * Add a version for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param version the version to add
+ * @return the added version
+ * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
+ * @see Version
+ */
+ Version addVersion(String projectName, Version version) throws RedmineServiceException;
+
+ /**
+ * Update a version for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param version the version to update
+ * @return the updated version
+ * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
+ * @see Version
+ */
+ Version updateVersion(String projectName, Version version) throws RedmineServiceException;
+
+ /**
+ * Prepare a new version (create it or update it).
+ * <p/>
+ * If the {@code oldVersionName} is given, then all issues unclosed from this
+ * old version will be move to the new version.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param oldVersionName the name of the old version (optional)
+ * @param newVersion the newVersion to create or update
+ * @return the created version
+ * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
+ * @see Version
+ */
+ Version nextVersion(String projectName, String oldVersionName, Version newVersion) throws RedmineServiceException;
+
+ /**
+ * Add a news for a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param news the news to add
+ * @return the added news.
+ * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
+ * @see News
+ */
+ News addNews(String projectName, News news) throws RedmineServiceException;
+
+ /**
+ * Add a attachment for a given version of a given project.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param versionName the name of the version
+ * @param attachement the attachment to add
+ * @return the added attachment
+ * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
+ * @see Attachment
+ */
+ Attachment addAttachment(String projectName, String versionName, Attachment attachement) throws RedmineServiceException;
+
+ /**
+ * Add a new time entry to the given issue for the given project and
+ * return the updated time entry.
+ * <p/>
+ * b>Note:</b> This method requires to be loggued on redmine server.
+ *
+ * @param projectName the name of the project
+ * @param issueId the id of the issue to update
+ * @param entry time entry to add
+ * @return the created time entry
+ * @throws RedmineServiceException if any pb while sending or retrieving datas to redmine server
+ * @see Issue
+ * @see TimeEntry
+ * @since 1.0.3
+ */
+ TimeEntry addIssueTimeEntry(String projectName, String issueId, TimeEntry entry) throws RedmineServiceException;
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineLogguedService.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineService.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -20,275 +20,21 @@
*/
package org.nuiton.jredmine;
-import org.nuiton.jredmine.model.*;
-
/**
- * The service that mirrors the rails {@code jredmine} plugin.
+ * The full service with anonymous methods and loggued ones.
+ * <p/>
+ * <b>Note:</b> A default implementation is offered :
+ * {@link DefaultRedmineService}
*
* @author chemit
+ * @see DefaultRedmineService
* @since 1.0.0
*/
-public interface RedmineService {
+public interface RedmineService extends RedmineAnonymousService, RedmineLogguedService {
/**
* Plexus lookup name
*/
String ROLE = RedmineService.class.getName();
- /**
- * Obtain all accessible projets for the loggued user.
- *
- * @return all the projects
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- */
- Project[] getProjects() throws RedmineServiceException;
-
- /**
- * Obtain for the loggued user, all projets where he belongs.
- * <p/>
- * <b>Note:</b> this method could return less projects than the method
- * {@link #getProjects()} since here the user must belongs to the project
- * and not just can access it.
- *
- * @return all the projects belonged by the loggued user
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- * @since 1.0.3
- */
- Project[] getUserProjects() throws RedmineServiceException;
-
- /**
- * Obtain all the priorities defined on a {@link Issue}.
- * <p/>
- * <b>Note : </b> The priorities are common for all projects.
- *
- * @return all the issue properties
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssuePriority
- */
- IssuePriority[] getIssuePriorities() throws RedmineServiceException;
-
- /**
- * Obtain all the statuses defined on a {@link Issue}.
- * <p/>
- * <b>Note : </b> The statuses are common for all projects.
- *
- * @return all the issue statuses
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssueStatus
- */
- IssueStatus[] getIssueStatuses() throws RedmineServiceException;
-
- /**
- * Obtain a project given his name.
- *
- * @param projectName the name of the project
- * @return the project
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Project
- */
- Project getProject(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all categories defined on issues for a given project.
- *
- * @param projectName the name of the project
- * @return the categories of issues for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see IssueCategory
- */
- IssueCategory[] getIssueCategories(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all trackers defined on a given project.
- *
- * @param projectName the name of the project
- * @return the trackers for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Tracker
- */
- Tracker[] getTrackers(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all news defined on a given project.
- *
- * @param projectName the name of the project
- * @return the news for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see News
- */
- News[] getNews(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all users defined on a given project.
- *
- * @param projectName the name of the project
- * @return the users for the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see User
- */
- User[] getUsers(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all versions defined on a given project.
- *
- * @param projectName the name of the project
- * @return the versions of the given project.
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Version
- */
- Version[] getVersions(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain a specific version for a given project.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the version
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Version
- */
- Version getVersion(String projectName, String versionName) throws RedmineServiceException;
-
- /**
- * Obtain all issues for a given project
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all opened issues for a given project
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getOpenedIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all closed issues for a given project
- *
- * @param projectName the name of the project
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- * @since 1.0.3
- */
- Issue[] getClosedIssues(String projectName) throws RedmineServiceException;
-
- /**
- * Obtain all issues for a specific version on a given project
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the issues
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Issue
- */
- Issue[] getIssues(String projectName, String versionName) throws RedmineServiceException;
-
- /**
- * Obtain all attachments for a specific version on a given project
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @return the attachments
- * @throws RedmineServiceException if any pb while retriving datas
- * @see Attachment
- */
- Attachment[] getAttachments(String projectName, String versionName) throws RedmineServiceException;
-
- /**
- * Add a version for a given project.
- *
- * @param projectName the name of the project
- * @param version the version to add
- * @return the added version
- * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
- * @see Version
- */
- Version addVersion(String projectName, Version version) throws RedmineServiceException;
-
- /**
- * Update a version for a given project.
- *
- * @param projectName the name of the project
- * @param version the version to update
- * @return the updated version
- * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
- * @see Version
- */
- Version updateVersion(String projectName, Version version) throws RedmineServiceException;
-
- /**
- * Prepare a new version (create it or update it).
- * <p/>
- * If the {@code oldVersionName} is given, then all issues unclosed from this
- * old version will be move to the new version.
- *
- * @param projectName the name of the project
- * @param oldVersionName the name of the old version (optional)
- * @param newVersion the newVersion to create or update
- * @return the created version
- * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
- * @see Version
- */
- Version nextVersion(String projectName, String oldVersionName, Version newVersion) throws RedmineServiceException;
-
- /**
- * Add a news for a given project.
- *
- * @param projectName the name of the project
- * @param news the news to add
- * @return the added news.
- * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
- * @see News
- */
- News addNews(String projectName, News news) throws RedmineServiceException;
-
- /**
- * Add a attachment for a given version of a given project.
- *
- * @param projectName the name of the project
- * @param versionName the name of the version
- * @param attachement the attachment to add
- * @return the added attachment
- * @throws RedmineServiceException if any pb while sending and retriving datas to redmine server
- * @see Attachment
- */
- Attachment addAttachment(String projectName, String versionName, Attachment attachement) throws RedmineServiceException;
-
- /**
- * Obtain for a given issue of a given project all the time entries.
- *
- * @param projectName the name of the project
- * @param issueId the id of the issue
- * @return the time entries of the issue
- * @throws RedmineServiceException if any pb while retrieving time entries of the issue
- * @since 1.0.3
- */
- TimeEntry[] getIssueTimeEntries(String projectName, String issueId) throws RedmineServiceException;
-
- /**
- * Add a new time entry to the given issue for the given project and
- * return the updated time entry.
- *
- * @param projectName the name of the project
- * @param issueId the id of the issue to update
- * @param entry time entry to add
- * @return the created time entry
- * @throws RedmineServiceException if any pb while sending or retrieving datas to redmine server
- * @see Issue
- * @see TimeEntry
- * @since 1.0.3
- */
- TimeEntry addIssueTimeEntry(String projectName, String issueId, TimeEntry entry) throws RedmineServiceException;
}
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceImplementor.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -24,15 +24,16 @@
import org.nuiton.io.rest.RestClientConfiguration;
import org.nuiton.jredmine.rest.RedmineRestClient;
-import java.io.InputStream;
-
/**
- * Technical contrat te be implemented in a {@link RedmineService}.
+ * Technical contract to implements a redmine service which wrap the
+ * {@link org.nuiton.jredmine.rest.RedmineRestClient}.
* <p/>
- * Any concrete implentation of a {@link RedmineService} should (must ?) also
- * implements this contract.
+ * A default implementation is offered in {@link org.nuiton.jredmine.DefaultRedmineServiceImplementor}.
+ * <p/>
+ * Any concrete implentation of a redmine service should implements this..
*
* @author chemit
+ * @see org.nuiton.jredmine.DefaultRedmineServiceImplementor
* @since 1.0.0
*/
public interface RedmineServiceImplementor {
@@ -48,12 +49,12 @@
/**
* Initialize the service given a redmine client already initialized.
*
- * @param client the redmine client to be used by the service
+ * @param session the redmine client to be used by the service
* @return the initialized service
* @throws RedmineServiceException if any pb
* @see RedmineRestClient
*/
- RedmineServiceImplementor init(RestClient client) throws RedmineServiceException;
+ RedmineServiceImplementor init(RestClient session) throws RedmineServiceException;
/**
* Initialize the service given a client configuration.
@@ -74,44 +75,69 @@
/**
* Generic method to obtain a single data from a redmine server.
*
- * @param <T> the type of data to obtain
- * @param type the type of data to obtain
- * @param args the parameters to obtain the data
+ * @param <T> the type of data to obtain
+ * @param requestName the name of the request to use
+ * @param type the type of data to obtain
+ * @param args the parameters to obtain the data
* @return the obtained data
* @throws RedmineServiceException if any pb
*/
- <T> T getData(Class<T> type, Object... args) throws RedmineServiceException;
+ <T> T getData(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
/**
* Generic method to obtain a array of data from a redmine server.
*
- * @param <T> the type of data to obtain
- * @param type the type of data to obtain
- * @param args the parameters to obtain the datas
+ * @param <T> the type of data to obtain
+ * @param requestName the name of the request to use
+ * @param type the type of data to obtain
+ * @param args the parameters to obtain the datas
* @return the obtained datas
* @throws RedmineServiceException if any pb
*/
- <T> T[] getDatas(Class<T> type, Object... args) throws RedmineServiceException;
+ <T> T[] getDatas(String requestName, Class<T> type, Object... args) throws RedmineServiceException;
/**
- * Generic method to obtain an input stream of a data from a redmine server.
+ * Generic method to send a data to a redmine server and return the single
+ * data updated from the redmine server.
*
- * @param <T> the type of data to obtain
- * @param type the type of data to obtain
- * @param args the parameters to obtain the data
- * @return the input stream containing the data
+ * @param requestName the name of the request used
+ * @param klazz the type of data to treate
+ * @param args the parameters of the request
+ * @param <T> the type of data to treate
+ * @return the updated data
* @throws RedmineServiceException if any pb
*/
- <T> InputStream getDataStream(Class<T> type, Object... args) throws RedmineServiceException;
+ <T> T sendData(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException;
+
/**
- * Generic method to obtain an input stream of an array of data from a redmine server.
+ * Generic method to send a data (or more ) to a redmine server and
+ * return the array of data from the redmine server.
*
- * @param <T> the type of data to obtain
- * @param type the type of data to obtain
- * @param args the parameters to obtain the datas
- * @return the input stream containing the datas
+ * @param requestName the name of the request used
+ * @param klazz the type of data to treate
+ * @param args the parameters of the request
+ * @param <T> the type of data to treate
+ * @return the updated data
* @throws RedmineServiceException if any pb
*/
- <T> InputStream getDatasStream(Class<T> type, Object... args) throws RedmineServiceException;
+ <T> T[] sendDatas(String requestName, Class<T> klazz, Object... args) throws RedmineServiceException;
+
+ /**
+ * Checks if the current session is not a anonymous one.
+ *
+ * @throws IllegalStateException if service not init
+ * @throws RedmineServiceLoginException if not loggued
+ * @throws NullPointerException if something is null
+ */
+ void checkLoggued() throws IllegalStateException, RedmineServiceLoginException, NullPointerException;
+
+ /**
+ * Checks if the current session is anonymous.
+ *
+ * @param session the session to test
+ * @throws RedmineServiceLoginException if not anonymous
+ * @throws NullPointerException if something is null
+ */
+ void checkNotLoggued(RestClient session) throws RedmineServiceLoginException, NullPointerException;
}
Added: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java (rev 0)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,34 @@
+package org.nuiton.jredmine;
+
+/**
+ * An exception to be thrown when a problem with authentication state in a
+ * {@link org.nuiton.jredmine.RedmineService}.
+ * <p/>
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ * @since 1.0.3
+ */
+public class RedmineServiceLoginException extends RedmineServiceException {
+
+ private static final long serialVersionUID = 1L;
+
+ public RedmineServiceLoginException() {
+ }
+
+ public RedmineServiceLoginException(Throwable cause) {
+ super(cause);
+ }
+
+ public RedmineServiceLoginException(String message) {
+ super(message);
+ }
+
+ public RedmineServiceLoginException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Property changes on: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/RedmineServiceLoginException.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/model/RedmineModelEnum.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -20,6 +20,8 @@
*/
package org.nuiton.jredmine.model;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
/**
* Un énumération pour connaitre l'ensemble des classes du modèle.
*
@@ -28,26 +30,29 @@
*/
public enum RedmineModelEnum {
- issueStatus(IssueStatus.class, RedmineModelScope.none),
- issuePriority(IssuePriority.class, RedmineModelScope.none),
- project(Project.class, RedmineModelScope.none),
- issueCategory(IssueCategory.class, RedmineModelScope.project),
- tracker(Tracker.class, RedmineModelScope.project),
- user(User.class, RedmineModelScope.project),
- news(News.class, RedmineModelScope.project),
- version(Version.class, RedmineModelScope.project),
- issue(Issue.class, RedmineModelScope.version),
- timeEntry(TimeEntry.class, RedmineModelScope.issue),
- attachment(Attachment.class, RedmineModelScope.version);
-
+ issueStatus(IssueStatus.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_STATUS_LIST),
+ issuePriority(IssuePriority.class, RedmineModelScope.none, RedmineRestClient.GET_ISSUE_PRIORITY_LIST),
+ project(Project.class, RedmineModelScope.none, RedmineRestClient.GET_PROJECT_LIST),
+ issueCategory(IssueCategory.class, RedmineModelScope.project, RedmineRestClient.GET_ISSUE_CATEGORY_LIST),
+ tracker(Tracker.class, RedmineModelScope.project, RedmineRestClient.GET_TRACKER_LIST),
+ user(User.class, RedmineModelScope.project, RedmineRestClient.GET_USER_LIST),
+ news(News.class, RedmineModelScope.project, RedmineRestClient.GET_NEWS_LIST),
+ version(Version.class, RedmineModelScope.project, RedmineRestClient.GET_VERSION_LIST),
+ issue(Issue.class, RedmineModelScope.version, RedmineRestClient.GET_ISSUE_LIST),
+ timeEntry(TimeEntry.class, RedmineModelScope.issue, RedmineRestClient.GET_ISSUE_TIME_ENTRY_LIST),
+ attachment(Attachment.class, RedmineModelScope.version, RedmineRestClient.GET_ATTACHMENTS_LIST);
+
private final Class<?> modelType;
private final RedmineModelScope scope;
+ private final String requestAll;
- private RedmineModelEnum(Class<?> modelType, RedmineModelScope scope) {
+ private RedmineModelEnum(Class<?> modelType, RedmineModelScope scope, String requestAll) {
this.modelType = modelType;
this.scope = scope;
+ this.requestAll = requestAll;
}
+
public Class<?> getModelType() {
return modelType;
}
@@ -56,6 +61,10 @@
return scope;
}
+ public String getRequestAll() {
+ return requestAll;
+ }
+
public static RedmineModelEnum valueOf(Class<?> type) {
for (RedmineModelEnum e : values()) {
if (type == e.getModelType()) {
Modified: trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java
===================================================================
--- trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/java/org/nuiton/jredmine/rest/RedmineRestClient.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -239,7 +239,9 @@
ping(session);
- login(session);
+ if (!configuration.isAnonymous()) {
+ login(session);
+ }
}
@Override
Modified: trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb
===================================================================
--- trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/main/redmine/jredmine/app/controllers/jredmine_controller.rb 2010-01-03 10:49:37 UTC (rev 66)
@@ -1,7 +1,8 @@
class JredmineController < ActionController::Base
# find user (after login)
- before_filter :find_user, :except => [:ping, :login]
+ before_filter :find_user, :only => [:get_user_projects, :add_version, :update_version, :add_news, :add_attachment, :add_version_attachment, :add_issue_time, :update_issue_time]
+ #before_filter :find_user, :except => [:ping, :login, :get_projects, :get_project_versions]
# find project and check permission
before_filter :find_project, :except => [:ping, :login, :logout, :get_projects, :get_user_projects, :get_issue_statuses, :get_issue_priorities]
Added: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java (rev 0)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,240 @@
+package org.nuiton.jredmine;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.junit.*;
+import org.nuiton.io.rest.RestClientConfiguration;
+import static org.nuiton.jredmine.TestHelper.getTestConfiguration;
+import org.nuiton.jredmine.model.*;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ */
+public abstract class AbstractRedmineServiceTest<S extends RedmineAnonymousService> implements RedmineTestContract {
+ /**
+ * Logger
+ */
+ private static final Log log = LogFactory.getLog(AbstractRedmineServiceTest.class);
+
+ /**
+ * shared rest client (open only one session for all the test)
+ */
+ static RedmineRestClient client;
+ /**
+ * service to test
+ */
+ private S service;
+
+ protected Project[] projects;
+ protected Project project;
+ protected Version[] versions;
+ protected Version version;
+ protected User[] users;
+ protected Issue[] issues;
+ protected IssuePriority[] issuePriorities;
+ protected IssueStatus[] issueStatuses;
+ protected IssueCategory[] issueCategories;
+ protected Tracker[] trackers;
+ protected News newz;
+ protected News[] news;
+ protected Attachment attachment;
+ protected Attachment[] attachments;
+ protected TimeEntry timeEntry;
+ protected TimeEntry[] timeEntries;
+
+ private final Class<S> serviceType;
+
+ public AbstractRedmineServiceTest(Class<S> serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ protected S getService() {
+ return service;
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ // make sure client is null before starting the test
+
+ client = null;
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ if (client != null) {
+ client.close();
+ client = null;
+ }
+ }
+
+ protected final S newService() throws Exception {
+ return serviceType.newInstance();
+ }
+
+ protected RedmineRestClient newClient(RestClientConfiguration configuration) {
+ RedmineRestClient client;
+ try {
+ client = new RedmineRestClient(configuration);
+
+ client.open();
+ } catch (Exception e) {
+
+ // could not log
+ if (log.isErrorEnabled()) {
+ log.error("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
+ }
+// System.out.println("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
+ client = null;
+ }
+ return client;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+
+ if (client == null) {
+
+ RestClientConfiguration configuration = getTestConfiguration();
+ try {
+ client = newClient(configuration);
+ } finally {
+ Assume.assumeTrue(client != null && client.isOpen());
+ }
+ }
+
+ service = newService();
+
+ ((RedmineServiceImplementor) service).init(client);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ service = null;
+ project = null;
+ projects = null;
+ version = null;
+ versions = null;
+ users = null;
+ issues = null;
+ issueCategories = null;
+ issuePriorities = null;
+ issueStatuses = null;
+ trackers = null;
+ newz = null;
+ news = null;
+ attachment = null;
+ attachments = null;
+ timeEntry = null;
+ timeEntries = null;
+ }
+
+
+ @Test
+ public void isInit() throws Exception {
+
+ Assert.assertFalse(((RedmineServiceImplementor) newService()).isInit());
+ }
+
+ @Test
+ @Override
+ public void getProjects() throws Exception {
+ projects = getService().getProjects();
+ }
+
+ @Test
+ @Override
+ public void getIssuePriorities() throws Exception {
+ issuePriorities = getService().getIssuePriorities();
+ }
+
+ @Test
+ @Override
+ public void getIssueStatuses() throws Exception {
+ issueStatuses = getService().getIssueStatuses();
+ }
+
+ @Test
+ @Override
+ public void getProject() throws Exception {
+ project = getService().getProject(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getIssueCategories() throws Exception {
+ issueCategories = getService().getIssueCategories(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getTrackers() throws Exception {
+ trackers = getService().getTrackers(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getNews() throws Exception {
+ news = getService().getNews(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getProjectMembers() throws Exception {
+ users = getService().getProjectMembers(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getProjectIssues() throws Exception {
+ issues = getService().getIssues(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getVersions() throws Exception {
+ versions = getService().getVersions(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getVersion() throws Exception {
+ version = getService().getVersion(PROJECT_NAME, VERSION_NAME);
+ }
+
+ @Test
+ @Override
+ public void getVersionIssues() throws Exception {
+ issues = getService().getIssues(PROJECT_NAME, VERSION_NAME);
+ }
+
+ @Test
+ @Override
+ public void getOpenedIssues() throws Exception {
+ issues = getService().getOpenedIssues(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getClosedIssues() throws Exception {
+ issues = getService().getClosedIssues(PROJECT_NAME);
+ }
+
+ @Test
+ @Override
+ public void getIssueTimeEntries() throws Exception {
+ timeEntries = getService().getIssueTimeEntries(PROJECT_NAME, ISSUE_ID);
+ }
+
+ @Test
+ @Override
+ public void getAttachments() throws Exception {
+ attachments = getService().getAttachments(PROJECT_NAME, VERSION_NAME);
+ }
+}
Property changes on: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/AbstractRedmineServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java (rev 0)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,71 @@
+package org.nuiton.jredmine;
+
+import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ */
+public class DefaultRedmineAnonymousServiceTest extends AbstractRedmineServiceTest<DefaultRedmineAnonymousService> {
+
+ public DefaultRedmineAnonymousServiceTest() {
+ super(DefaultRedmineAnonymousService.class);
+ }
+
+ @Override
+ protected RedmineRestClient newClient(RestClientConfiguration configuration) {
+ configuration.setAnonymous(true);
+ return super.newClient(configuration);
+ }
+
+ @Test
+ @Override
+ public void getUserProjects() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void addVersion() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void addAttachment() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void addNews() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void updateVersion() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void nextVersion() throws Exception {
+ // not for anonymous service
+ }
+
+ @Test
+ @Override
+ public void addIssueTime() throws Exception {
+ // not for anonymous service
+ }
+
+
+}
Property changes on: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineAnonymousServiceTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Added: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java (rev 0)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,81 @@
+package org.nuiton.jredmine;
+
+import org.junit.Test;
+import org.nuiton.io.rest.RestClientConfiguration;
+import org.nuiton.jredmine.model.Attachment;
+import org.nuiton.jredmine.model.News;
+import org.nuiton.jredmine.model.TimeEntry;
+import org.nuiton.jredmine.model.Version;
+import org.nuiton.jredmine.rest.RedmineRestClient;
+
+/**
+ * Created: 2 janv. 2010
+ *
+ * @author Tony Chemit <chemit(a)codelutin.com> Copyright Code Lutin
+ * @version $Revision$
+ * <p/>
+ * Mise a jour: $Date$ par :
+ * $Author: tchemit $
+ */
+public class DefaultRedmineServiceAsAnonymousTest extends AbstractRedmineServiceTest<DefaultRedmineService> {
+
+ public DefaultRedmineServiceAsAnonymousTest() {
+ super(DefaultRedmineService.class);
+ }
+
+ @Override
+ protected RedmineRestClient newClient(RestClientConfiguration configuration) {
+ configuration.setAnonymous(true);
+ return super.newClient(configuration);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void getUserProjects() throws Exception {
+ projects = getService().getUserProjects();
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void addVersion() throws Exception {
+ version = new Version();
+ getService().addVersion(PROJECT_NAME, version);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void addAttachment() throws Exception {
+ attachment = new Attachment();
+ getService().addAttachment(PROJECT_NAME, VERSION_NAME, attachment);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void addNews() throws Exception {
+ newz = new News();
+ getService().addNews(PROJECT_NAME, newz);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void updateVersion() throws Exception {
+ version = new Version();
+ getService().updateVersion(PROJECT_NAME, version);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void nextVersion() throws Exception {
+
+ version = new Version();
+ getService().nextVersion(PROJECT_NAME, VERSION_NAME, version);
+ }
+
+ @Test(expected = RedmineServiceLoginException.class)
+ @Override
+ public void addIssueTime() throws Exception {
+ timeEntry = new TimeEntry();
+ getService().addIssueTimeEntry(PROJECT_NAME, ISSUE_ID, timeEntry);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceAsAnonymousTest.java
___________________________________________________________________
Added: svn:keywords
+ "Author Date Id Revision HeadURL
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/DefaultRedmineServiceTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -20,222 +20,61 @@
*/
package org.nuiton.jredmine;
-import org.junit.*;
-import org.nuiton.io.rest.RestClientConfiguration;
-import static org.nuiton.jredmine.TestHelper.getTestConfiguration;
-import org.nuiton.jredmine.model.*;
-import org.nuiton.jredmine.rest.RedmineRestClient;
+import org.junit.Test;
/**
* @author chemit
*/
-public class DefaultRedmineServiceTest implements RedmineTestContract {
+public class DefaultRedmineServiceTest extends AbstractRedmineServiceTest<DefaultRedmineService> {
- /**
- * shared rest client (open only one session for all the test)
- */
- static RedmineRestClient client;
- /**
- * service to test
- */
- RedmineService service;
-
- Project[] projects;
- Project project;
- Version[] versions;
- Version version;
- User[] users;
- Issue[] issues;
- IssuePriority[] issuePriorities;
- IssueStatus[] issueStatuses;
- IssueCategory[] issueCategories;
- Tracker[] trackers;
- News[] news;
- Attachment[] attachments;
- TimeEntry[] timeEntries;
-
-
- @BeforeClass
- public static void setUpClass() throws Exception {
- RestClientConfiguration configuration = getTestConfiguration();
-
- client = new RedmineRestClient(configuration);
- try {
-
- client.open();
- } catch (Exception e) {
-
- // could not log
- System.out.println("can not connect to server " + configuration.getRestUrl() + ", will skip test " + DefaultRedmineServiceTest.class.getName());
- } finally {
- Assume.assumeTrue(client != null && client.isOpen());
- }
+ public DefaultRedmineServiceTest() {
+ super(DefaultRedmineService.class);
}
- @AfterClass
- public static void tearDownClass() throws Exception {
- if (client != null) {
- client.close();
- }
- }
-
- @Before
- public void setUp() throws Exception {
- service = new DefaultRedmineService();
-
- ((RedmineServiceImplementor) service).init(client);
- }
-
- @After
- public void tearDown() throws Exception {
-
- service = null;
- }
-
-
@Test
- public void isInit() throws Exception {
-
- Assert.assertFalse(new DefaultRedmineService().isInit());
- }
-
-
- @Test
@Override
- public void getProjects() throws Exception {
- projects = service.getProjects();
+ public void getUserProjects() throws Exception {
+ projects = getService().getUserProjects();
}
@Test
@Override
- public void getIssuePriorities() throws Exception {
- issuePriorities = service.getIssuePriorities();
- }
-
- @Test
- @Override
- public void getIssueStatuses() throws Exception {
- issueStatuses = service.getIssueStatuses();
- }
-
- @Test
- @Override
- public void getProject() throws Exception {
- project = service.getProject(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getIssueCategories() throws Exception {
- issueCategories = service.getIssueCategories(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getTrackers() throws Exception {
- trackers = service.getTrackers(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getNews() throws Exception {
- news = service.getNews(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getUsers() throws Exception {
- users = service.getUsers(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getProjectIssues() throws Exception {
- issues = service.getIssues(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getVersions() throws Exception {
- versions = service.getVersions(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getVersion() throws Exception {
- version = service.getVersion(PROJECT_NAME, VERSION_NAME);
- }
-
- @Test
- @Override
- public void getVersionIssues() throws Exception {
- issues = service.getIssues(PROJECT_NAME, VERSION_NAME);
- }
-
- @Test
- @Override
- public void getOpenedIssues() throws Exception {
- issues = service.getOpenedIssues(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getClosedIssues() throws Exception {
- issues = service.getClosedIssues(PROJECT_NAME);
- }
-
- @Test
- @Override
- public void getIssueTimeEntries() throws Exception {
- timeEntries = service.getIssueTimeEntries(PROJECT_NAME, ISSUE_ID);
- }
-
-
- @Test
- @Override
- public void getAttachments() throws Exception {
- attachments = service.getAttachments(PROJECT_NAME, VERSION_NAME);
- }
-
- @Test
- @Override
public void addVersion() throws Exception {
- //TODO
+ // TODO
}
@Test
@Override
public void addAttachment() throws Exception {
- //TODO
+ // TODO
}
@Test
@Override
public void addNews() throws Exception {
- //TODO
+ // TODO
}
@Test
@Override
public void updateVersion() throws Exception {
- //TODO
+ // TODO
}
@Test
@Override
public void nextVersion() throws Exception {
- //TODO
+ // TODO
}
@Test
@Override
public void addIssueTime() throws Exception {
- TimeEntry timeEntry = new TimeEntry();
- timeEntry.setActivityId(9);
- timeEntry.setComments("ajout time");
- timeEntry.setHours(3.5f);
-// timeEntry.setSpentOn(new Date());
- service.addIssueTimeEntry(PROJECT_NAME, ISSUE_ID, timeEntry);
- //TODO
+// TimeEntry timeEntry = new TimeEntry();
+// timeEntry.setActivityId(9);
+// timeEntry.setComments("ajout time");
+// timeEntry.setHours(3.5f);
+//// timeEntry.setSpentOn(new Date());
+// getService().addIssueTimeEntry(PROJECT_NAME, ISSUE_ID, timeEntry);
}
}
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/RedmineTestContract.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -32,8 +32,10 @@
void getNews() throws Exception;
- void getUsers() throws Exception;
+ void getUserProjects() throws Exception;
+ void getProjectMembers() throws Exception;
+
void getProjectIssues() throws Exception;
void getVersions() throws Exception;
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/TestHelper.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -46,7 +46,7 @@
protected static Properties defaultConfig;
protected static Properties userConfig;
protected static EnumMap<RedmineModelEnum, List<?>> memoryModel;
-
+
public static void initDefaultConfiguration() throws IOException {
if (DEFAULT_CONFIGURATION != null) {
Modified: trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java
===================================================================
--- trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/test/java/org/nuiton/jredmine/rest/RedmineRestClientTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -142,9 +142,14 @@
}
@Override
- @Test
- public void getUsers() throws Exception {
+ public void getUserProjects() throws Exception {
+
+ doRequest(RedmineRestClient.GET_USER_PROJECTS, PROJECT_NAME);
+ }
+ @Override
+ public void getProjectMembers() throws Exception {
+
doRequest(RedmineRestClient.GET_USER_LIST, PROJECT_NAME);
}
Modified: trunk/jredmine-client/src/test/resources/log4j.properties
===================================================================
--- trunk/jredmine-client/src/test/resources/log4j.properties 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/jredmine-client/src/test/resources/log4j.properties 2010-01-03 10:49:37 UTC (rev 66)
@@ -23,4 +23,5 @@
log4j.logger.org.nuiton.jredmine=INFO
log4j.logger.org.nuiton.io.rest=INFO
+#log4j.logger.org.nuiton.io.xpp3.Xpp3Helper=DEBUG
log4j.logger.org.apache.commons.httpclient.HttpClient=INFO
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -173,12 +173,15 @@
protected boolean serviceInit;
protected boolean initOk = true;
+ private boolean anonymous;
public AbstractRedmineMojo(boolean requireProject, boolean requireVersion, boolean requireUser) {
super();
this.requireProject = requireProject;
this.requireVersion = requireVersion;
this.requireUser = requireUser;
+ // by default, requires to be loggued
+ this.anonymous = false;
}
///////////////////////////////////////////////////////////////////////////
@@ -246,7 +249,7 @@
serviceInit = false;
initOk = false;
// if (verbose) {
- getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'", e);
+ getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'", e);
// }
// return false;
}
@@ -315,7 +318,7 @@
getLog().info("skip goal, runOnce flag is on, and was already executed.");
return false;
}
-
+
if (!serviceInit) {
getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'");
return false;
@@ -501,6 +504,16 @@
this.encoding = encoding;
}
+ @Override
+ public boolean isAnonymous() {
+ return anonymous;
+ }
+
+ @Override
+ public void setAnonymous(boolean anonymous) {
+ this.anonymous = true;
+ }
+
///////////////////////////////////////////////////////////////////////////
/// Others
///////////////////////////////////////////////////////////////////////////
@@ -557,7 +570,7 @@
protected boolean initReleaseUser() {
try {
- users = service.getUsers(projectId);
+ users = service.getProjectMembers(projectId);
User user = ModelHelper.byLogin(username, users);
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/DisplayDataMojo.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -65,6 +65,8 @@
public DisplayDataMojo() {
super(false, false, false);
+ // no need to be loggued to obtain informations from redmine
+ setAnonymous(true);
}
@Override
@@ -94,6 +96,8 @@
return;
}
actions = getDownloadActions(types,
+ RedmineModelEnum.project,
+ RedmineModelEnum.version,
RedmineModelEnum.issueStatus,
RedmineModelEnum.issuePriority,
RedmineModelEnum.issueCategory,
@@ -131,7 +135,8 @@
RedmineModelScope scope = entry.getScope();
- Object[] datas = ((RedmineServiceImplementor) service).getDatas(entry.getModelType(), projectId, versionId);
+ String requestName = entry.getRequestAll();
+ Object[] datas = ((RedmineServiceImplementor) service).getDatas(requestName, entry.getModelType(), projectId, versionId);
buffer.append("\nValues of '").append(entry).append('\'');
if (scope == RedmineModelScope.project || scope == RedmineModelScope.version) {
buffer.append(" for project ").append(projectId);
Modified: trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java
===================================================================
--- trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/AbstractRedmineMojoTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -20,7 +20,10 @@
*/
package org.nuiton.jredmine.plugin;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.maven.model.IssueManagement;
+import org.junit.After;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.nuiton.jredmine.TestHelper;
@@ -36,6 +39,11 @@
*/
public abstract class AbstractRedmineMojoTest<P extends AbstractRedmineMojo> extends AbstractMojoTest<P> {
+ /**
+ * Logger
+ */
+ private static final Log log = LogFactory.getLog(AbstractRedmineMojoTest.class);
+
@BeforeClass
public static void atTheBegining() throws IOException {
@@ -53,7 +61,6 @@
i.setSystem(AbstractRedmineMojo.REDMINE_SYSTEM);
i.setUrl(mojo.getRestUrl() + "/projects/one/issues");
mojo.getProject().setIssueManagement(i);
-
}
@Override
@@ -68,7 +75,14 @@
try {
mojo.init();
canContinue = mojo.checkSkip();
+ if (!canContinue) {
+ if (log.isInfoEnabled()) {
+ log.info("The goal was marked as to be skip, the test is done.");
+ }
+ return;
+ }
} catch (Exception e) {
+ log.error(e);
canContinue = false;
}
if (canContinue) {
@@ -80,6 +94,14 @@
}
}
+ @After
+ public void tearDown() throws Exception {
+ P mojo = getMojo();
+ if (mojo != null) {
+ mojo.closeService();
+ }
+ }
+
protected void mojoDoAction() throws Exception {
if (!canContinue) {
return;
Modified: trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java
===================================================================
--- trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/maven-jredmine-plugin/src/test/java/org/nuiton/jredmine/plugin/DisplayDataMojoTest.java 2010-01-03 10:49:37 UTC (rev 66)
@@ -34,6 +34,16 @@
}
@Test
+ public void displayProjects() throws Exception {
+ mojoDoAction();
+ }
+
+ @Test
+ public void displayVersions() throws Exception {
+ mojoDoAction();
+ }
+
+ @Test
public void displayProjectTrackers() throws Exception {
mojoDoAction();
}
Copied: trunk/maven-jredmine-plugin/src/test/resources/log4j.properties (from rev 65, trunk/maven-jredmine-plugin/src/main/resources/log4j.properties)
===================================================================
--- trunk/maven-jredmine-plugin/src/test/resources/log4j.properties (rev 0)
+++ trunk/maven-jredmine-plugin/src/test/resources/log4j.properties 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, 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.
+
+log4j.rootCategory=WARN, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=[%p] (%c{1}:%L) - %m%n
+
+log4j.logger.org.nuiton.jredmine=INFO
+log4j.logger.org.nuiton.io.rest=INFO
+log4j.logger.org.nuiton.plugin.AbstractMojoTest=INFO
+log4j.logger.org.apache.commons.httpclient.HttpClient=INFO
Modified: trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml
===================================================================
--- trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2010-01-01 20:45:06 UTC (rev 65)
+++ trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayAll.xml 2010-01-03 10:49:37 UTC (rev 66)
@@ -19,7 +19,7 @@
<configuration>
<projectId>one</projectId>
<versionId>1.0.0</versionId>
- <types>tracker,user,issueStatus,issueCategory,issuePriority,tracker</types>
+ <types>project,version,tracker,user,issueStatus,issueCategory,issuePriority,tracker</types>
</configuration>
<executions>
<execution>
Added: trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml
===================================================================
--- trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml (rev 0)
+++ trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayProjects.xml 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,34 @@
+<?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">
+
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>generate-changes</name>
+
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <configuration>
+ <!--<projectId>one</projectId>-->
+ <!--<versionId>1.0.0</versionId>-->
+ <types>project</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml
===================================================================
--- trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml (rev 0)
+++ trunk/maven-jredmine-plugin/src/test/resources/org/nuiton/jredmine/plugin/displayDataMojoTest/displayVersions.xml 2010-01-03 10:49:37 UTC (rev 66)
@@ -0,0 +1,34 @@
+<?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">
+
+ <groupId>org.nuiton.maven-redmine-plugin</groupId>
+ <artifactId>test-generate-changes</artifactId>
+ <version>0</version>
+ <modelVersion>4.0.0</modelVersion>
+
+ <name>generate-changes</name>
+
+ <build>
+
+ <plugins>
+ <plugin>
+ <groupId>org.nuiton.jredmine</groupId>
+ <artifactId>maven-jredmine-plugin</artifactId>
+ <configuration>
+ <projectId>one</projectId>
+ <!--<versionId>1.0.0</versionId>-->
+ <types>version</types>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>display-data</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
1
0
Author: tchemit
Date: 2010-01-01 21:45:06 +0100 (Fri, 01 Jan 2010)
New Revision: 65
Modified:
trunk/maven-jredmine-plugin/pom.xml
Log:
arch in fact its can not pass if your have not a redmine test server accessible...
Modified: trunk/maven-jredmine-plugin/pom.xml
===================================================================
--- trunk/maven-jredmine-plugin/pom.xml 2010-01-01 20:08:36 UTC (rev 64)
+++ trunk/maven-jredmine-plugin/pom.xml 2010-01-01 20:45:06 UTC (rev 65)
@@ -179,12 +179,12 @@
<profile>
<id>run-its</id>
- <activation>
+ <!--activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
- </activation>
+ </activation-->
<build>
<plugins>
<plugin>
1
0
r64 - in trunk/maven-jredmine-plugin: . src/it/single_failed src/main/java/org/nuiton/jredmine/plugin src/main/java/org/nuiton/jredmine/plugin/announcement
by tchemit@users.nuiton.org 01 Jan '10
by tchemit@users.nuiton.org 01 Jan '10
01 Jan '10
Author: tchemit
Date: 2010-01-01 21:08:36 +0100 (Fri, 01 Jan 2010)
New Revision: 64
Modified:
trunk/maven-jredmine-plugin/pom.xml
trunk/maven-jredmine-plugin/src/it/single_failed/invoker.properties
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
Log:
- make runOnceDone works with new maven-helper-plugin api
- improve console logs
Modified: trunk/maven-jredmine-plugin/pom.xml
===================================================================
--- trunk/maven-jredmine-plugin/pom.xml 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/pom.xml 2010-01-01 20:08:36 UTC (rev 64)
@@ -210,7 +210,7 @@
<goal>install</goal>
<goal>run</goal>
</goals>
- <phase>validate</phase>
+ <!--<phase>validate</phase>-->
</execution>
</executions>
</plugin>
Modified: trunk/maven-jredmine-plugin/src/it/single_failed/invoker.properties
===================================================================
--- trunk/maven-jredmine-plugin/src/it/single_failed/invoker.properties 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/it/single_failed/invoker.properties 2010-01-01 20:08:36 UTC (rev 64)
@@ -12,10 +12,10 @@
#invoker.mavenOpts=-Dfile.encoding=UTF-16 -Xms32m -Xmx256m
# Possible values are "fail-fast" (default), "fail-at-end" and "fail-never"
-invoker.failureBehavior=fail-at-end
+#invoker.failureBehavior=fail-at-end
# The expected result of the build, possible values are "success" (default) and "failure"
-#invoker.buildResult=success
+invoker.buildResult=failure
# A boolean value controlling the -N flag, defaults to "false"
#invoker.nonRecursive=false
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/AbstractRedmineMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -246,7 +246,7 @@
serviceInit = false;
initOk = false;
// if (verbose) {
-// getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'", e);
+ getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'", e);
// }
// return false;
}
@@ -257,7 +257,7 @@
boolean r = initReleaseProject();
if (!r) {
if (safe) {
- throw new MojoExecutionException("the project '" + projectId + "' could not be retrieve from redmine server, goal is skip");
+ throw new MojoExecutionException("the project '" + projectId + "' could not be retrieve from redmine server.");
}
initOk = false;
return;
@@ -274,7 +274,7 @@
boolean r = initReleaseUser();
if (!r) {
if (safe) {
- throw new MojoExecutionException("the user '" + this.username + "' could not be retrieve from redmine server, goal is skip");
+ throw new MojoExecutionException("the user '" + this.username + "' could not be retrieve from redmine server.");
}
initOk = false;
return;
@@ -291,7 +291,7 @@
boolean r = initReleaseVersion();
if (!r) {
if (safe) {
- throw new MojoExecutionException("the version '" + versionId + "' could not be retrieve from redmine server, goal is skip");
+ throw new MojoExecutionException("the version '" + versionId + "' could not be retrieve from redmine server.");
}
initOk = false;
}
@@ -311,7 +311,11 @@
getLog().warn("The goal is skip due to the skipGoal flag on");
return false;
}
-
+ if (isRunOnce() && isRunOnceDone()) {
+ getLog().info("skip goal, runOnce flag is on, and was already executed.");
+ return false;
+ }
+
if (!serviceInit) {
getLog().error("could not init Redmine service [" + getRestUrl() + "] with user '" + getRestUsername() + "'");
return false;
@@ -332,10 +336,6 @@
return false;
}
- if (isRunOnce() && isRunOnceDone()) {
-
- }
-
return true;
}
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/GenerateChangesMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -30,6 +30,7 @@
import org.nuiton.plugin.PluginHelper;
import java.io.File;
+import java.io.IOException;
import java.util.*;
import java.util.Map.Entry;
@@ -415,20 +416,21 @@
@Override
protected boolean checkSkip() {
- boolean b = super.checkSkip();
- if (!b) {
- return false;
- }
-
if (isRunOnceDone()) {
if (!xmlPath.exists()) {
- getLog().info("skip goal, work already done.");
- return false;
+ getLog().info("Use already generated " + xmlPath.getName() + " (" + cacheChangesFile + ")");
+
+ try {
+ createDirectoryIfNecessary(xmlPath.getParentFile());
+ copyFile(cacheChangesFile, xmlPath);
+ } catch (IOException e) {
+ throw new IllegalStateException("could not copy already generated file " + xmlPath + " from " + cacheChangesFile);
+ }
}
}
-
- return true;
+ boolean b = super.checkSkip();
+ return b;
}
@Override
@@ -440,25 +442,25 @@
// xmlParent.mkdirs();
// }
- if (isRunOnceDone()) {
-
-// if (!xmlPath.exists()) {
- // just copy the already generated changes.xml fil
-
- getLog().info("Use already generated " + xmlPath.getName() + " (" + cacheChangesFile + ")");
-
- copyFile(cacheChangesFile, xmlPath);
-// } else {
+// if (isRunOnceDone()) {
//
-// getLog().info("skip goal, work already done.");
-// }
- return;
- }
+//// if (!xmlPath.exists()) {
+// // just copy the already generated changes.xml fil
+//
+// getLog().info("Use already generated " + xmlPath.getName() + " (" + cacheChangesFile + ")");
+//
+// copyFile(cacheChangesFile, xmlPath);
+//// } else {
+////
+//// getLog().info("skip goal, work already done.");
+//// }
+// return;
+// }
if (releaseVersion.getEffectiveDate() == null) {
- getLog().warn("The version " + versionId + " is not effective on redmine, should update effective-date property to today");
- //TODO call the reset service rest/update_version
+ getLog().debug("The version " + versionId + " is not effective on redmine, should update effective-date property to today");
+
releaseVersion.setEffectiveDate(new Date());
}
@@ -479,7 +481,7 @@
} catch (RedmineServiceException ex) {
collector.clearFilters();
- throw new MojoExecutionException("could not obtains issues for reason " + ex.getMessage(), ex);
+ throw new MojoExecutionException("could not obtain issues for reason " + ex.getMessage(), ex);
}
//TODO make some logic checks : version must be
@@ -493,7 +495,7 @@
xppWriter.write(writer, doc);
- getLog().info("File saved in " + xmlPath.getParentFile().getAbsolutePath());
+ getLog().info("File saved in " + xmlPath);
// cache result
cacheChangesFile = xmlPath;
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/NextVersionMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -117,18 +117,15 @@
return isRunOnce() && !isExecutionRoot();
}
- @Override
- protected boolean checkSkip() {
- boolean b = super.checkSkip();
- if (!b) {
- return false;
- }
- if (isRunOnceDone()) {
- getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
- return false;
- }
- return true;
- }
+// @Override
+// protected boolean checkSkip() {
+// if (isRunOnceDone()) {
+// getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
+// return false;
+// }
+// boolean b = super.checkSkip();
+// return b;
+// }
@Override
protected void init() throws Exception {
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishAttachmentsMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -168,14 +168,15 @@
@Override
protected boolean checkSkip() {
+// if (isRunOnceDone()) {
+// getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
+// return false;
+// }
boolean b = super.checkSkip();
if (!b) {
return false;
}
- if (isRunOnceDone()) {
- getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
- return false;
- }
+
if (allFiles == null || allFiles.isEmpty()) {
getLog().warn("No attachment to publish, will skip the goal.");
return false;
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/PublishNewsMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -147,18 +147,15 @@
// return true;
}
- @Override
- protected boolean checkSkip() {
- boolean b = super.checkSkip();
- if (!b) {
- return false;
- }
- if (isRunOnceDone()) {
- getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
- return false;
- }
- return true;
- }
+// @Override
+// protected boolean checkSkip() {
+// if (isRunOnceDone()) {
+// getLog().info("runOnce flag is on and goal was already executed, will skip the goal.");
+// return false;
+// }
+// boolean b = super.checkSkip();
+// return b;
+// }
@Override
protected void doAction() throws Exception {
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/UpdateVersionMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -146,18 +146,15 @@
// return super.init();
}
- @Override
- protected boolean checkSkip() {
- boolean b = super.checkSkip();
- if (!b) {
- return false;
- }
- if (isRunOnceDone()) {
- getLog().info("skip goal, runOnce flag is on, and was already executed.");
- return false;
- }
- return true;
- }
+// @Override
+// protected boolean checkSkip() {
+// if (isRunOnceDone()) {
+// getLog().info("skip goal, runOnce flag is on, and was already executed.");
+// return false;
+// }
+// boolean b = super.checkSkip();
+// return b;
+// }
@Override
protected void doAction() throws Exception {
Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java
===================================================================
--- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2010-01-01 18:02:48 UTC (rev 63)
+++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/announcement/AbstractAnnouncementMojo.java 2010-01-01 20:08:36 UTC (rev 64)
@@ -238,7 +238,7 @@
"File encoding has not been set, using platform encoding " + templateEncoding + ", i.e. build is platform dependent!");
}
- if (introduction == null || introduction.trim().isEmpty()) {
+ if (StringUtils.isEmpty(introduction)) {
introduction = project.getUrl();
}
@@ -247,18 +247,15 @@
// return true;
}
- @Override
- protected boolean checkSkip() {
- boolean b = super.checkSkip();
- if (!b) {
- return false;
- }
- if (isRunOnceDone()) {
- getLog().info("skip goal, runOnce flag is on, and was already executed.");
- return false;
- }
- return true;
- }
+// @Override
+// protected boolean checkSkip() {
+//// if (isRunOnceDone()) {
+//// getLog().info("skip goal, runOnce flag is on, and was already executed.");
+//// return false;
+//// }
+// boolean b = super.checkSkip();
+// return b;
+// }
@Override
protected void doAction() throws Exception {
@@ -277,12 +274,10 @@
File out = new File(templateOutputDirectory, template);
- if (verbose) {
- getLog().info("destination file " + out);
- }
+ getLog().info("Apply template [" + template + "]");
+ getLog().info(" from : " + xmlPath);
+ getLog().info(" to : " + out);
- getLog().info("Creating announcement [" + template + "] from " + xmlPath);
-
VelocityEngine engine = velocity.getEngine();
engine.setApplicationAttribute("baseDirectory", basedir);
@@ -296,7 +291,7 @@
generator.doGenerate(engine, context, out, templateDirectory + "/" + template, templateEncoding);
- getLog().info("Created announcement [" + template + "] in " + out);
+ getLog().debug("Created announcement [" + template + "] in " + out);
}
1
0