continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r354104 - in /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven: m1/DefaultMavenOneMetadataHelper.java m2/DefaultMavenBuilderHelper.java
Date Mon, 05 Dec 2005 17:18:59 GMT
Author: evenisse
Date: Mon Dec  5 09:18:53 2005
New Revision: 354104

URL: http://svn.apache.org/viewcvs?rev=354104&view=rev
Log:
PR: CONTINUUM-492

Notifiers are now optional.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java?rev=354104&r1=354103&r2=354104&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/DefaultMavenOneMetadataHelper.java
Mon Dec  5 09:18:53 2005
@@ -252,10 +252,6 @@
             {
                 notifiers = project.getNotifiers();
             }
-            else
-            {
-                throw new MavenOneMetadataHelperException( "Missing 'build' element in the
POM." );
-            }
         }
         else
         {
@@ -277,8 +273,6 @@
 
         if ( notifier == null && ( notifiers == null || notifiers.isEmpty() ) )
         {
-            throw new MavenOneMetadataHelperException(
-                "Missing 'nagEmailAddress' element in the 'build' element in the POM." );
         }
         else
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=354104&r1=354103&r2=354104&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Mon Dec  5 09:18:53 2005
@@ -215,21 +215,24 @@
 
         List userNotifiers = new ArrayList();
 
-        for ( int i = 0; i < continuumProject.getNotifiers().size(); i++ )
+        if ( continuumProject.getNotifiers() != null )
         {
-            ProjectNotifier notifier = (ProjectNotifier) continuumProject.getNotifiers().get(
i );
-
-            if ( notifier.isFromUser() )
+            for ( int i = 0; i < continuumProject.getNotifiers().size(); i++ )
             {
-                ProjectNotifier userNotifier = new ProjectNotifier();
+                ProjectNotifier notifier = (ProjectNotifier) continuumProject.getNotifiers().get(
i );
+
+                if ( notifier.isFromUser() )
+                {
+                    ProjectNotifier userNotifier = new ProjectNotifier();
 
-                userNotifier.setType( notifier.getType() );
+                    userNotifier.setType( notifier.getType() );
 
-                userNotifier.setConfiguration( notifier.getConfiguration() );
+                    userNotifier.setConfiguration( notifier.getConfiguration() );
 
-                userNotifier.setFrom( notifier.getFrom() );
+                    userNotifier.setFrom( notifier.getFrom() );
 
-                userNotifiers.add( userNotifier );
+                    userNotifiers.add( userNotifier );
+                }
             }
         }
 
@@ -269,20 +272,6 @@
         // Validate the MavenProject using some Continuum rules
         // ----------------------------------------------------------------------
 
-        // Nag email address
-        CiManagement ciManagement = project.getCiManagement();
-
-        if ( ciManagement == null )
-        {
-            throw new MavenBuilderHelperException( "Missing 'ciManagement' element in the
" + getProjectName( project ) + " POM." );
-        }
-
-        if ( getNotifiers( project ).isEmpty() )
-        {
-            throw new MavenBuilderHelperException(
-                "Missing 'notifiers' element in the 'ciManagement' element in the " + getProjectName(
project ) + " POM." );
-        }
-
         // SCM connection
         Scm scm = project.getScm();
 
@@ -327,37 +316,40 @@
     {
         List notifiers = new ArrayList();
 
-        for ( Iterator i = mavenProject.getCiManagement().getNotifiers().iterator(); i.hasNext();
)
+        if ( mavenProject.getCiManagement() != null && mavenProject.getCiManagement().getNotifiers()
!= null )
         {
-            Notifier projectNotifier = (Notifier) i.next();
+            for ( Iterator i = mavenProject.getCiManagement().getNotifiers().iterator();
i.hasNext(); )
+            {
+                Notifier projectNotifier = (Notifier) i.next();
 
-            ProjectNotifier notifier = new ProjectNotifier();
+                ProjectNotifier notifier = new ProjectNotifier();
 
-            if ( StringUtils.isEmpty( projectNotifier.getType() ) )
-            {
-                throw new MavenBuilderHelperException( "Missing type from notifier." );
-            }
+                if ( StringUtils.isEmpty( projectNotifier.getType() ) )
+                {
+                    throw new MavenBuilderHelperException( "Missing type from notifier."
);
+                }
 
-            notifier.setType( projectNotifier.getType() );
+                notifier.setType( projectNotifier.getType() );
 
-            if ( projectNotifier.getConfiguration() == null )
-            {
-                throw new MavenBuilderHelperException( "Notifier configuration cannot be
null." );
-            }
+                if ( projectNotifier.getConfiguration() == null )
+                {
+                    throw new MavenBuilderHelperException( "Notifier configuration cannot
be null." );
+                }
 
-            notifier.setConfiguration( projectNotifier.getConfiguration() );
+                notifier.setConfiguration( projectNotifier.getConfiguration() );
 
-            notifier.setFrom( ProjectNotifier.FROM_PROJECT );
+                notifier.setFrom( ProjectNotifier.FROM_PROJECT );
 
-            notifier.setSendOnSuccess( projectNotifier.isSendOnSuccess() );
+                notifier.setSendOnSuccess( projectNotifier.isSendOnSuccess() );
 
-            notifier.setSendOnFailure( projectNotifier.isSendOnFailure() );
+                notifier.setSendOnFailure( projectNotifier.isSendOnFailure() );
 
-            notifier.setSendOnError( projectNotifier.isSendOnError() );
+                notifier.setSendOnError( projectNotifier.isSendOnError() );
 
-            notifier.setSendOnWarning( projectNotifier.isSendOnWarning() );
+                notifier.setSendOnWarning( projectNotifier.isSendOnWarning() );
 
-            notifiers.add( notifier );
+                notifiers.add( notifier );
+            }
         }
 
         return notifiers;



Mime
View raw message