maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/plugin OgnlProjectValueExtractor.java
Date Thu, 30 Sep 2004 15:09:48 GMT
jvanzyl     2004/09/30 08:09:48

  Modified:    maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase
                        GoalAttainmentPhase.java
               maven-core/src/main/java/org/apache/maven/plugin
                        OgnlProjectValueExtractor.java
  Log:
  o throw an exception when there is a plugin configuration problem whether
    that be a bad expression or validation problem.
  
  Revision  Changes    Path
  1.2       +11 -2     maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase/GoalAttainmentPhase.java
  
  Index: GoalAttainmentPhase.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/lifecycle/goal/phase/GoalAttainmentPhase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GoalAttainmentPhase.java	15 Aug 2004 15:01:51 -0000	1.1
  +++ GoalAttainmentPhase.java	30 Sep 2004 15:09:48 -0000	1.2
  @@ -23,6 +23,7 @@
   import org.apache.maven.plugin.Plugin;
   import org.apache.maven.plugin.PluginExecutionRequest;
   import org.apache.maven.plugin.PluginExecutionResponse;
  +import org.apache.maven.plugin.PluginConfigurationException;
   import org.apache.maven.plugin.descriptor.MojoDescriptor;
   import org.apache.maven.plugin.descriptor.Parameter;
   import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
  @@ -54,7 +55,14 @@
   
               getLogger().info( "[" + mojoDescriptor.getId() + "]" );
   
  -            request = new PluginExecutionRequest( createParameters( mojoDescriptor, context
) );
  +            try
  +            {
  +                request = new PluginExecutionRequest( createParameters( mojoDescriptor,
context ) );
  +            }
  +            catch ( PluginConfigurationException e )
  +            {
  +                throw new GoalExecutionException( "Error configuring plugin for execution.",
e );
  +            }
   
               response = new PluginExecutionResponse();
   
  @@ -93,6 +101,7 @@
       }
   
       private Map createParameters( MojoDescriptor goal, MavenGoalExecutionContext context
)
  +        throws PluginConfigurationException
       {
           Map map = null;
   
  
  
  
  1.10      +4 -3      maven-components/maven-core/src/main/java/org/apache/maven/plugin/OgnlProjectValueExtractor.java
  
  Index: OgnlProjectValueExtractor.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/OgnlProjectValueExtractor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- OgnlProjectValueExtractor.java	20 Sep 2004 03:07:32 -0000	1.9
  +++ OgnlProjectValueExtractor.java	30 Sep 2004 15:09:48 -0000	1.10
  @@ -28,6 +28,7 @@
   public class OgnlProjectValueExtractor
   {
       public static Object evaluate( String expression, MavenGoalExecutionContext context
)
  +        throws PluginConfigurationException
       {
           Object value = null;
   
  @@ -80,8 +81,8 @@
               }
               catch ( OgnlException e )
               {
  -                // do nothing
  -                e.printStackTrace(); // TODO: should log? should ignore as previously?
  +                throw new PluginConfigurationException(
  +                    "Error evaluating plugin parameter expression: " + expression, e );
               }
           }
           else if ( expression.equals( "#basedir" ) )
  
  
  

Mime
View raw message