svn commit: r422246 - in /maven/sandbox/plugins/maven-changes-plugin: ./ src/main/java/org/apache/maven/changes/ src/main/java/org/apache/maven/jira/

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r422246 - in /maven/sandbox/plugins/maven-changes-plugin: ./ src/main/java/org/apache/maven/changes/ src/main/java/org/apache/maven/jira/

Dennis Lundberg-2
Author: dennisl
Date: Sat Jul 15 08:06:53 2006
New Revision: 422246

URL: http://svn.apache.org/viewvc?rev=422246&view=rev
Log:
[MCHANGES-15] move to reporting api 2.0 and add canGenerateReport() method
Change from org.codehaus.doxia to org.apache.maven.doxia

Modified:
    maven/sandbox/plugins/maven-changes-plugin/pom.xml
    maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
    maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java
    maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java
    maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java

Modified: maven/sandbox/plugins/maven-changes-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-changes-plugin/pom.xml?rev=422246&r1=422245&r2=422246&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-changes-plugin/pom.xml (original)
+++ maven/sandbox/plugins/maven-changes-plugin/pom.xml Sat Jul 15 08:06:53 2006
@@ -28,7 +28,7 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-settings</artifactId>
-      <version>2.0-beta-1</version>
+      <version>2.0.4</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>
@@ -48,7 +48,7 @@
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-api</artifactId>
-      <version>2.0-beta-1</version>
+      <version>2.0.4</version>
     </dependency>
     <dependency>
       <groupId>commons-logging</groupId>
@@ -58,17 +58,12 @@
     <dependency>
       <groupId>org.apache.maven.reporting</groupId>
       <artifactId>maven-reporting-impl</artifactId>
-      <version>2.0-beta-1</version>
+      <version>2.0.4</version>
     </dependency>
     <dependency>
       <groupId>velocity</groupId>
       <artifactId>velocity</artifactId>
       <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>doxia</groupId>
-      <artifactId>doxia-sink-api</artifactId>
-      <version>1.0-alpha-4</version>
     </dependency>
     <dependency>
       <groupId>commons-httpclient</groupId>

Modified: maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java?rev=422246&r1=422245&r2=422246&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java (original)
+++ maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java Sat Jul 15 08:06:53 2006
@@ -22,10 +22,10 @@
 import java.util.Locale;
 import java.util.ResourceBundle;
 
+import org.apache.maven.doxia.siterenderer.Renderer;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.reporting.AbstractMavenReport;
 import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.doxia.site.renderer.SiteRenderer;
 import org.codehaus.plexus.util.FileUtils;
 
 /**
@@ -48,11 +48,11 @@
     private String outputDirectory;
 
     /**
-     * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}"
+     * @parameter expression="${component.org.apache.maven.doxia.siterenderer.Renderer}"
      * @required
      * @readonly
      */
-    private SiteRenderer siteRenderer;
+    private Renderer siteRenderer;
 
     /**
      * @parameter expression="${project}"
@@ -142,7 +142,7 @@
         return getBundle( locale ).getString( "report.changes.description" );
     }
 
-    protected SiteRenderer getSiteRenderer()
+    protected Renderer getSiteRenderer()
     {
         return siteRenderer;
     }

Modified: maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java?rev=422246&r1=422245&r2=422246&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java (original)
+++ maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesReportGenerator.java Sat Jul 15 08:06:53 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.changes;
 
 /*
- * Copyright 2001-2005 The Codehaus.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@
 import java.util.List;
 import java.util.ResourceBundle;
 
+import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.reporting.MavenReportException;
-import org.codehaus.doxia.sink.Sink;
 
 public class ChangesReportGenerator
 {

Modified: maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java?rev=422246&r1=422245&r2=422246&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java (original)
+++ maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraMojo.java Sat Jul 15 08:06:53 2006
@@ -21,7 +21,7 @@
 import org.apache.maven.reporting.MavenReportException;
 import org.apache.maven.settings.Settings;
 
-import org.codehaus.doxia.site.renderer.SiteRenderer;
+import org.apache.maven.doxia.siterenderer.Renderer;
 
 import java.io.File;
 import java.util.Locale;
@@ -58,11 +58,11 @@
     /**
      * Doxia Site Renderer.
      *
-     * @parameter expression="${component.org.codehaus.doxia.site.renderer.SiteRenderer}"
+     * @parameter expression="${component.org.apache.maven.doxia.siterenderer.Renderer}"
      * @required
      * @readonly
      */
-    private SiteRenderer siteRenderer;
+    private Renderer siteRenderer;
 
     /**
      * The Maven Project.
@@ -160,40 +160,39 @@
      */
     private String webPassword;
 
+    /**
+     * @see org.apache.maven.reporting.AbstractMavenReport#canGenerateReport()
+     */
+    public boolean canGenerateReport()
+    {
+        return validateIfIssueManagementComplete();
+    }
+
     public void executeReport( Locale locale )
         throws MavenReportException
     {
-        if ( validateIfIssueManagementComplete() )
-        {
-            JiraDownloader2 jira = new JiraDownloader2();
-
-            setJiraDownloaderParameter( jira );
+        JiraDownloader2 jira = new JiraDownloader2();
 
-            JiraReportGenerator report;
+        setJiraDownloaderParameter( jira );
 
-            try
-            {
-                jira.doExecute();
-
-                if ( !( new File( jiraXmlPath ).exists() ) )
-                {
-                    return;
-                }
+        JiraReportGenerator report;
 
-                report = new JiraReportGenerator( jiraXmlPath );
+        try
+        {
+            jira.doExecute();
 
-                report.doGenerateReport( getBundle( locale ), getSink() );
-            }
-            catch ( Exception e )
+            if ( !( new File( jiraXmlPath ).exists() ) )
             {
-                e.printStackTrace();
+                return;
             }
+
+            report = new JiraReportGenerator( jiraXmlPath );
+
+            report.doGenerateReport( getBundle( locale ), getSink() );
         }
-        else
+        catch ( Exception e )
         {
-            JiraReportGenerator report = new JiraReportGenerator();
-
-            report.doGenerateEmptyReport( getBundle( locale ), getSink() );
+            e.printStackTrace();
         }
     }
 
@@ -207,7 +206,7 @@
         return getBundle( locale ).getString( "report.jira.description" );
     }
 
-    protected SiteRenderer getSiteRenderer()
+    protected Renderer getSiteRenderer()
     {
         return siteRenderer;
     }

Modified: maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java
URL: http://svn.apache.org/viewvc/maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java?rev=422246&r1=422245&r2=422246&view=diff
==============================================================================
--- maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java (original)
+++ maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/jira/JiraReportGenerator.java Sat Jul 15 08:06:53 2006
@@ -1,7 +1,7 @@
 package org.apache.maven.jira;
 
 /*
- * Copyright 2001-2005 The Codehaus.
+ * Copyright 2001-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
 import java.util.List;
 import java.util.ResourceBundle;
 
-import org.codehaus.doxia.sink.Sink;
+import org.apache.maven.doxia.sink.Sink;
 
 public class JiraReportGenerator
 {
@@ -44,13 +44,6 @@
         constructHeaderRow( sink, issueList, bundle );
 
         constructDetailRows( sink, issueList );
-
-        sinkEndReport( sink );
-    }
-
-    public void doGenerateEmptyReport( ResourceBundle bundle, Sink sink )
-    {
-        sinkBeginReport( sink, bundle );
 
         sinkEndReport( sink );
     }