maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mper...@apache.org
Subject svn commit: r407653 - /maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java
Date Thu, 18 May 2006 22:50:00 GMT
Author: mperham
Date: Thu May 18 15:50:00 2006
New Revision: 407653

URL: http://svn.apache.org/viewvc?rev=407653&view=rev
Log:
Update changes report to ignore missing changes.xml rather than treating it as an error.

Modified:
    maven/sandbox/plugins/maven-changes-plugin/src/main/java/org/apache/maven/changes/ChangesMojo.java

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=407653&r1=407652&r2=407653&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
Thu May 18 15:50:00 2006
@@ -79,37 +79,25 @@
      */
     private String url;
 
+	public boolean canGenerateReport() 
+	{
+        File xmlFile = new File( xmlPath );
+        return xmlFile.exists();
+	}
+
     public void executeReport( Locale locale )
         throws MavenReportException
     {
+		ChangesReportGenerator report = new ChangesReportGenerator( xmlPath );
 
-        File xmlFile = new File( xmlPath );
-
-        if ( !xmlFile.exists() )
-        {
-            getLog().error( getBundle( locale ).getString( "report.changes.error" ) );
-
-            ChangesReportGenerator report = new ChangesReportGenerator();
-
-            report.doGenerateEmptyReport( getBundle( locale ), getSink(), getBundle( locale
)
-                .getString( "report.changes.error" ) );
-        }
-        else
-        {
-            ChangesReportGenerator report = new ChangesReportGenerator( xmlPath );
-
-            if ( ( url == null ) || ( url.trim().equals( "" ) ) )
-            {
-                getLog().warn( getBundle( locale ).getString( "report.changes.warn.url" )
);
-            }
-
-            report.setIssueLink( link_template );
-
-            report.setUrl( url );
-
-            report.doGenerateReport( getBundle( locale ), getSink() );
-        }
-
+		if ( ( url == null ) || ( url.trim().equals( "" ) ) )
+		{
+			getLog().warn( getBundle( locale ).getString( "report.changes.warn.url" ) );
+		}
+
+		report.setIssueLink( link_template );
+		report.setUrl( url );
+		report.doGenerateReport( getBundle( locale ), getSink() );
     }
 
     public String getName( Locale locale )



Mime
View raw message