Author: tchemit Date: 2010-01-23 21:17:17 +0100 (Sat, 23 Jan 2010) New Revision: 107 Added: trunk/maven-jredmine-plugin/src/it/skip-report/ trunk/maven-jredmine-plugin/src/it/skip-report/invoker.properties trunk/maven-jredmine-plugin/src/it/skip-report/pom.xml trunk/maven-jredmine-plugin/src/it/skip-report/verify.groovy Modified: trunk/maven-jredmine-plugin/pom.xml trunk/maven-jredmine-plugin/src/it/report/pom.xml trunk/maven-jredmine-plugin/src/it/report/verify.groovy 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/AbstractRedmineReport.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java Log: Evolution #263: Can skip reports Modified: trunk/maven-jredmine-plugin/pom.xml =================================================================== --- trunk/maven-jredmine-plugin/pom.xml 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/pom.xml 2010-01-23 20:17:17 UTC (rev 107) @@ -166,14 +166,13 @@ <pomInclude>single_failed/pom.xml</pomInclude> <pomInclude>single/pom.xml</pomInclude> <pomInclude>multi/pom.xml</pomInclude> + <pomInclude>skip-report/pom.xml</pomInclude> <pomInclude>report/pom.xml</pomInclude> </pomIncludes> <postBuildHookScript>verify</postBuildHookScript> - <localRepositoryPath>${basedir}/target/local-repo - </localRepositoryPath> + <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath> <settingsFile>src/it/settings.xml</settingsFile> - <cloneProjectsTo>${project.build.directory}/its - </cloneProjectsTo> + <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo> </configuration> <executions> <execution> Modified: trunk/maven-jredmine-plugin/src/it/report/pom.xml =================================================================== --- trunk/maven-jredmine-plugin/src/it/report/pom.xml 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/it/report/pom.xml 2010-01-23 20:17:17 UTC (rev 107) @@ -96,10 +96,12 @@ <reportSet> <reports> <report>issues-report</report> - <report>issues-report-by-tracker</report> - <report>issues-report-by-status</report> + <report>issues-report-by-assignee</report> <report>issues-report-by-category</report> <report>issues-report-by-priority</report> + <report>issues-report-by-reporter</report> + <report>issues-report-by-status</report> + <report>issues-report-by-tracker</report> <report>issues-report-by-version</report> </reports> </reportSet> Modified: trunk/maven-jredmine-plugin/src/it/report/verify.groovy =================================================================== --- trunk/maven-jredmine-plugin/src/it/report/verify.groovy 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/it/report/verify.groovy 2010-01-23 20:17:17 UTC (rev 107) @@ -18,15 +18,12 @@ * under the License. */ assert new File(basedir, 'target/site/redmine-report.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-assignee.html').exists(); assert new File(basedir, 'target/site/redmine-report-by-category.html').exists(); assert new File(basedir, 'target/site/redmine-report-by-priority.html').exists(); + assert new File(basedir, 'target/site/redmine-report-by-reporter.html').exists(); assert new File(basedir, 'target/site/redmine-report-by-status.html').exists(); assert new File(basedir, 'target/site/redmine-report-by-tracker.html').exists(); assert new File(basedir, 'target/site/redmine-report-by-version.html').exists(); - assert new File(basedir, 'target/site/redmine-report.html').exists(); -//content = new File(basedir, 'target/announcement/announcement.vm').text; - -//assert content.contains( 'Test report.' ); - return true; Copied: trunk/maven-jredmine-plugin/src/it/skip-report/invoker.properties (from rev 103, trunk/maven-jredmine-plugin/src/it/report/invoker.properties) =================================================================== --- trunk/maven-jredmine-plugin/src/it/skip-report/invoker.properties (rev 0) +++ trunk/maven-jredmine-plugin/src/it/skip-report/invoker.properties 2010-01-23 20:17:17 UTC (rev 107) @@ -0,0 +1,21 @@ +# A comma or space separated list of goals/phases to execute, may +# specify an empty list to execute the default goal of the IT project +invoker.goals=clean initialize site + +# Optionally, a list of goals to run during further invocations of Maven +#invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:run + +# A comma or space separated list of profiles to activate +#invoker.profiles=its,jdk15 + +# The value for the environment variable MAVEN_OPTS +#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 + +# The expected result of the build, possible values are "success" (default) and "failure" +#invoker.buildResult=success + +# A boolean value controlling the -N flag, defaults to "false" +#invoker.nonRecursive=false Copied: trunk/maven-jredmine-plugin/src/it/skip-report/pom.xml (from rev 103, trunk/maven-jredmine-plugin/src/it/report/pom.xml) =================================================================== --- trunk/maven-jredmine-plugin/src/it/skip-report/pom.xml (rev 0) +++ trunk/maven-jredmine-plugin/src/it/skip-report/pom.xml 2010-01-23 20:17:17 UTC (rev 107) @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + 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. +--> + +<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> + + <groupId>org.nuiton.jredmine</groupId> + <artifactId>test-report</artifactId> + <version>0</version> + + <name>JRedmine report</name> + <packaging>pom</packaging> + <description>Test JRedmine plugin reports</description> + + <url>http://www.foo.com</url> + + <issueManagement> + <system>redmine</system> + <url>http://www.mynuiton.org/projects/one/issues</url> + </issueManagement> + + <properties> + + <pluginVersion>@pom.version@</pluginVersion> + + <redmine.serverId>redmine-local</redmine.serverId> + <redmine.projectId>one</redmine.projectId> + <redmine.versionId>1.0.0</redmine.versionId> + + <!-- default encoding --> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <!--<redmine.url>http://www.mynuiton.org</redmine.url>--> + </properties> + + <build> + <plugins> + <plugin> + <groupId>org.nuiton</groupId> + <artifactId>maven-helper-plugin</artifactId> + <version>1.0.3</version> + <executions> + <execution> + <id>get-redmine-login</id> + <goals> + <goal>share-server-secret</goal> + </goals> + <phase>initialize</phase> + <configuration> + <serverId>${redmine.serverId}</serverId> + <passwordOut>redmine.password</passwordOut> + <usernameOut>redmine.username</usernameOut> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <reporting> + <plugins> + + <plugin> + <groupId>org.nuiton.jredmine</groupId> + <artifactId>maven-jredmine-plugin</artifactId> + <version>${pluginVersion}</version> + <configuration> + <serverId>redmine-local</serverId> + <projectId>one</projectId> + <versionId>1.0.0</versionId> + <issueLinkTemplate>http://www.mynuiton.org/issues/show/%ISSUE%</issueLinkTemplate> + <versionLinkTemplate>http://www.mynuiton.org/versions/show/%VERSION%</versionLinkTemplate> + <columnNames>key,summary,status,assignee,reporter,tracker,priority,version,category,createdOn</columnNames> + <skipIssueReport>true</skipIssueReport> + <skipIssueReportByAssignee>true</skipIssueReportByAssignee> + <skipIssueReportByCategory>true</skipIssueReportByCategory> + <skipIssueReportByPriority>true</skipIssueReportByPriority> + <skipIssueReportByReporter>true</skipIssueReportByReporter> + <skipIssueReportByStatus>true</skipIssueReportByStatus> + <skipIssueReportByTracker>true</skipIssueReportByTracker> + <skipIssueReportByVersion>true</skipIssueReportByVersion> + </configuration> + <reportSets> + <reportSet> + <reports> + <report>issues-report</report> + <report>issues-report-by-assignee</report> + <report>issues-report-by-category</report> + <report>issues-report-by-priority</report> + <report>issues-report-by-reporter</report> + <report>issues-report-by-status</report> + <report>issues-report-by-tracker</report> + <report>issues-report-by-version</report> + </reports> + </reportSet> + </reportSets> + </plugin> + + </plugins> + </reporting> + +</project> Copied: trunk/maven-jredmine-plugin/src/it/skip-report/verify.groovy (from rev 103, trunk/maven-jredmine-plugin/src/it/report/verify.groovy) =================================================================== --- trunk/maven-jredmine-plugin/src/it/skip-report/verify.groovy (rev 0) +++ trunk/maven-jredmine-plugin/src/it/skip-report/verify.groovy 2010-01-23 20:17:17 UTC (rev 107) @@ -0,0 +1,29 @@ + +/* + * 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. + */ + assert !new File(basedir, 'target/site/redmine-report.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-assignee.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-category.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-priority.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-reporter.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-status.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-tracker.html').exists(); + assert !new File(basedir, 'target/site/redmine-report-by-version.html').exists(); + +return true; 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-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractIssuesReport.java 2010-01-23 20:17:17 UTC (rev 107) @@ -127,6 +127,8 @@ issues = collector.getIssues(); + // store it in cache + issuesCache.put(this, issues); } catch (RedmineServiceException ex) { Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/AbstractRedmineReport.java 2010-01-23 20:17:17 UTC (rev 107) @@ -130,6 +130,11 @@ protected abstract void executeReport(Locale locale) throws MavenReportException; + /** + * @return {@code true} if report should be skip + */ + protected abstract boolean skipReport(); + public AbstractRedmineReport(boolean requireProject, boolean requireVersion, boolean requireUser) { super(requireProject, requireVersion, requireUser); } @@ -187,6 +192,10 @@ if (getLog().isDebugEnabled()) { getLog().debug("check can use report"); } + if (skipReport()) { + getLog().info("User ask to skip report \"" + getName(Locale.ENGLISH) + "\"."); + return false; + } if (session.getSettings().isOffline()) { // skip when offline getLog().info("Skipped \"" + getName(Locale.ENGLISH) + "\" report in offline mode."); Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReport.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNames; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReport}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReport; + + @Override + protected boolean skipReport() { + return skipIssueReport; + } + public IssuesReport() { super(null); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByAssignee.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByAssignee; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByAssignee}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReportByAssignee; + + @Override + protected boolean skipReport() { + return skipIssueReportByAssignee; + } + public IssuesReportByAssignee() { super("assignee"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByCategory.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByCategory; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByCategory}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReportByCategory; + + @Override + protected boolean skipReport() { + return skipIssueReportByCategory; + } + public IssuesReportByCategory() { super("category"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByPriority.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByPriority; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByPriority}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReport; + + @Override + protected boolean skipReport() { + return skipIssueReport; + } + public IssuesReportByPriority() { super("priority"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByReporter.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByReporter; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByReporter}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReportByReporter; + + @Override + protected boolean skipReport() { + return skipIssueReportByReporter; + } + public IssuesReportByReporter() { super("reporter"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByStatus.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,32 +96,21 @@ */ protected String columnNamesByStatus; /** - * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this - * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. - * <p> - * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the - * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' - * and everything that comes after it. <code>%ISSUE%</code>: this is the issue number. - * </p> + * A flag to skip the report. * - * @parameter expression="${redmine.issueLinkTemplate}" - * @since 1.0.0 - */ - protected String issueLinkTemplateByStatus; - /** - * Template strings per system that is used to discover the URL to use to display an issue report. Each key in this - * map denotes the (case-sensitive) identifier of the issue tracking system and its value gives the URL template. - * <p> - * There are 2 template tokens you can use. <code>%URL%</code>: this is computed by getting the - * <code><issueManagement>/<url></code> value from the POM, and removing the last '/' - * and everything that comes after it. <code>%VERSION%</code>: this is the issue number. - * </p> + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. * - * @parameter expression="${redmine.versionLinkTemplate}" + * @parameter expression="${redmine.skipIssueReportByStatus}" default-value="false" * @since 1.0.0 */ - protected String versionLinkTemplateByStatus; + protected boolean skipIssueReportByStatus; + @Override + protected boolean skipReport() { + return skipIssueReportByStatus; + } + public IssuesReportByStatus() { super("status"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByTracker.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByTracker; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByTracker}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReportByTracker; + + @Override + protected boolean skipReport() { + return skipIssueReportByTracker; + } + public IssuesReportByTracker() { super("tracker"); } Modified: trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java =================================================================== --- trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2010-01-23 20:12:07 UTC (rev 106) +++ trunk/maven-jredmine-plugin/src/main/java/org/nuiton/jredmine/plugin/report/IssuesReportByVersion.java 2010-01-23 20:17:17 UTC (rev 107) @@ -96,6 +96,22 @@ */ protected String columnNamesByVersion; + /** + * A flag to skip the report. + * + * This can be usefull since there is no way to skip a report from an + * inherited reportSet configuration. + * + * @parameter expression="${redmine.skipIssueReportByVersion}" default-value="false" + * @since 1.0.0 + */ + protected boolean skipIssueReportByVersion; + + @Override + protected boolean skipReport() { + return skipIssueReportByVersion; + } + public IssuesReportByVersion() { super("version"); }