maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r1129881 - /maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
Date Tue, 31 May 2011 19:49:33 GMT
Author: dennisl
Date: Tue May 31 19:49:33 2011
New Revision: 1129881

URL: http://svn.apache.org/viewvc?rev=1129881&view=rev
Log:
[MCHANGES-250] ccAddresses and bccAddresses should not be 'required'

Modified:
    maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java

Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java?rev=1129881&r1=1129880&r2=1129881&view=diff
==============================================================================
--- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
(original)
+++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/announcement/AnnouncementMailMojo.java
Tue May 31 19:49:33 2011
@@ -161,7 +161,6 @@ public class AnnouncementMailMojo
      * Recipient cc email address.
      *
      * @parameter
-     * @required
      * @since 2.5
      */
     private List ccAddresses;
@@ -170,7 +169,6 @@ public class AnnouncementMailMojo
      * Recipient bcc email address.
      *
      * @parameter
-     * @required
      * @since 2.5
      */
     private List bccAddresses;
@@ -266,6 +264,7 @@ public class AnnouncementMailMojo
             mailMsg.setContent( IOUtil.toString( readAnnouncement( templateFile ) ) );
             mailMsg.setContentType( this.mailContentType );
             mailMsg.setFrom( fromAddress, fromName );
+
             final Iterator it = getToAddresses().iterator();
             while ( it.hasNext() )
             {
@@ -273,20 +272,29 @@ public class AnnouncementMailMojo
                 getLog().info( "Sending mail to " + email + "..." );
                 mailMsg.addTo( email, "" );
             }
-            final Iterator it2 = getCcAddresses().iterator();
-            while ( it2.hasNext() )
+
+            if(getCcAddresses() != null)
             {
-                email = it2.next().toString();
-                getLog().info( "Sending cc mail to " + email + "..." );
-                mailMsg.addCc( email, "" );
+                final Iterator it2 = getCcAddresses().iterator();
+                while ( it2.hasNext() )
+                {
+                    email = it2.next().toString();
+                    getLog().info( "Sending cc mail to " + email + "..." );
+                    mailMsg.addCc( email, "" );
+                }
             }
-            final Iterator it3 = getBccAddresses().iterator();
-            while ( it3.hasNext() )
+
+            if(getBccAddresses() != null)
             {
-                email = it3.next().toString();
-                getLog().info( "Sending bcc mail to " + email + "..." );
-                mailMsg.addBcc( email, "" );
+                final Iterator it3 = getBccAddresses().iterator();
+                while ( it3.hasNext() )
+                {
+                    email = it3.next().toString();
+                    getLog().info( "Sending bcc mail to " + email + "..." );
+                    mailMsg.addBcc( email, "" );
+                }
             }
+
             mailer.send( mailMsg );
             getLog().info( "Sent..." );
         }



Mime
View raw message