continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r280576 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/ continuum-core/src/test/resources/org/apache/maven/continuum/notification/ continuum-core/src/test/resources/org/apache/maven/co...
Date Tue, 13 Sep 2005 15:31:44 GMT
Author: evenisse
Date: Tue Sep 13 08:31:33 2005
New Revision: 280576

URL: http://svn.apache.org/viewcvs?rev=280576&view=rev
Log:
[CONTINUUM-257] Ability to not include the build result in the mails.
We choose the mode to use in MailContinuumNotifier component configuration in application.xml

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
    maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
    maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=280576&r1=280575&r2=280576&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
Tue Sep 13 08:31:33 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.configuration.ConfigurationService;
 import org.apache.maven.continuum.model.project.BuildResult;
 import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.notification.AbstractContinuumNotifier;
 import org.apache.maven.continuum.notification.ContinuumNotificationDispatcher;
 import org.apache.maven.continuum.notification.ContinuumRecipientSource;
 import org.apache.maven.continuum.project.ContinuumProjectState;
@@ -31,7 +32,6 @@
 import org.codehaus.plexus.mailsender.MailSender;
 import org.codehaus.plexus.mailsender.MailSenderException;
 import org.codehaus.plexus.notification.NotificationException;
-import org.codehaus.plexus.notification.notifier.AbstractNotifier;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.velocity.VelocityComponent;
@@ -50,7 +50,7 @@
  * @version $Id$
  */
 public class MailContinuumNotifier
-    extends AbstractNotifier
+    extends AbstractContinuumNotifier
     implements Initializable
 {
     // ----------------------------------------------------------------------
@@ -96,6 +96,11 @@
      */
     private String timestampFormat;
 
+    /**
+     * @plexus.configuration
+     */
+    private boolean includeBuildResult = true;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -226,37 +231,44 @@
 
         try
         {
-            VelocityContext context = new VelocityContext();
+            if ( includeBuildResult )
+            {
+                VelocityContext context = new VelocityContext();
 
-            // ----------------------------------------------------------------------
-            // Data objects
-            // ----------------------------------------------------------------------
+                // ----------------------------------------------------------------------
+                // Data objects
+                // ----------------------------------------------------------------------
 
-            context.put( "project", project );
+                context.put( "project", project );
 
-            context.put( "build", build );
+                context.put( "build", build );
 
-            context.put( "buildOutput", buildOutput );
+                context.put( "buildOutput", buildOutput );
 
-            context.put( "previousBuild", previousBuild );
+                context.put( "previousBuild", previousBuild );
 
-            // ----------------------------------------------------------------------
-            // Tools
-            // ----------------------------------------------------------------------
+                // ----------------------------------------------------------------------
+                // Tools
+                // ----------------------------------------------------------------------
 
-            context.put( "formatter", formatterTool );
+                context.put( "formatter", formatterTool );
 
-            // TODO: Make the build host a part of the build
+                // TODO: Make the build host a part of the build
 
-            context.put( "buildHost", buildHost );
+                context.put( "buildHost", buildHost );
 
-            // ----------------------------------------------------------------------
-            //
-            // ----------------------------------------------------------------------
+                // ----------------------------------------------------------------------
+                // Generate
+                // ----------------------------------------------------------------------
 
-            velocity.getEngine().mergeTemplate( templateName, context, writer );
+                velocity.getEngine().mergeTemplate( templateName, context, writer );
 
-            content = writer.getBuffer().toString();
+                content = writer.getBuffer().toString();
+            }
+            else
+            {
+                content = getReportUrl( project, build, configurationService );
+            }
         }
         catch ( ResourceNotFoundException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml?rev=280576&r1=280575&r2=280576&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/ContinuumNotificationDispatcherTest.xml
Tue Sep 13 08:31:33 2005
@@ -35,11 +35,15 @@
         <requirement>
           <role>org.codehaus.plexus.mailsender.MailSender</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
+        </requirement>
       </requirements>
       <configuration>
         <fromMailbox>continuum@localhost</fromMailbox>
         <fromName>Continuum</fromName>
         <timestampFormat>EEE, d MMM yyyy HH:mm:ss Z</timestampFormat>
+        <includeBuildResult>true</includeBuildResult>
       </configuration>
     </component>
 

Modified: maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml?rev=280576&r1=280575&r2=280576&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/test/resources/org/apache/maven/continuum/notification/mail/MailContinuumNotifierTest.xml
Tue Sep 13 08:31:33 2005
@@ -28,11 +28,15 @@
         <requirement>
           <role>org.codehaus.plexus.mailsender.MailSender</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
+        </requirement>
       </requirements>
       <configuration>
         <fromMailbox>continuum@localhost</fromMailbox>
         <fromName>Continuum</fromName>
         <timestampFormat>EEE, d MMM yyyy HH:mm:ss Z</timestampFormat>
+        <includeBuildResult>true</includeBuildResult>
       </configuration>
     </component>
   </components>

Modified: maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml?rev=280576&r1=280575&r2=280576&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml (original)
+++ maven/continuum/trunk/continuum-plexus-application/src/conf/application.xml Tue Sep 13
08:31:33 2005
@@ -91,6 +91,7 @@
         <from-mailbox>@mail.override.from.mailbox@</from-mailbox>
         <from-name>@mail.override.from.name@</from-name>
         <timestamp-format>EEE, d MMM yyyy HH:mm:ss Z</timestamp-format>
+        <includeBuildResult>true</includeBuildResult>
       </configuration>
     </component>
 



Mime
View raw message