brett       2004/04/13 18:03:44

  Modified:    src/java/org/apache/maven/jelly/tags/werkz Tag:
                        MAVEN-1_0-BRANCH MavenGoalTag.java
               src/java/org/apache/maven/plugin Tag: MAVEN-1_0-BRANCH
                        PluginManager.java
               xdocs    Tag: MAVEN-1_0-BRANCH changes.xml
  Log:
  PR: MPAPPSERVER-6
  fix NPE when goals are defined via j:import
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.4.11  +18 -6     
maven/src/java/org/apache/maven/jelly/tags/werkz/MavenGoalTag.java
  
  Index: MavenGoalTag.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/java/org/apache/maven/jelly/tags/werkz/MavenGoalTag.java,v
  retrieving revision 1.2.4.10
  retrieving revision 1.2.4.11
  diff -u -r1.2.4.10 -r1.2.4.11
  --- MavenGoalTag.java 28 Mar 2004 21:27:27 -0000      1.2.4.10
  +++ MavenGoalTag.java 14 Apr 2004 01:03:44 -0000      1.2.4.11
  @@ -67,7 +67,8 @@
           {
               super.doTag( output );
               goal = getProject().getGoal( getName() );
  -            goal.setAction( new MavenGoalAction() );
  +            JellyScriptHousing currentHousing = ( JellyScriptHousing ) 
getContext().getVariable( PluginManager.PLUGIN_HOUSING );
  +            goal.setAction( new MavenGoalAction( currentHousing ) );
           }
       }
   
  @@ -83,14 +84,25 @@
        */
       public class MavenGoalAction implements Action
       {
  +        private final JellyScriptHousing housing;
  +
  +        public MavenGoalAction( JellyScriptHousing housing )
  +        {
  +            super();
  +            this.housing = housing;
  +            if ( housing == null )
  +            {
  +                throw new NullPointerException( "Plugin Housing can not be null" );
  +            }
  +        }
  +
           public void performAction( Session session ) throws Exception
           {
               MavenJellyContext oldContext = ( MavenJellyContext ) getContext();
   
  -            GoalToJellyScriptHousingMapper mapper = ( 
GoalToJellyScriptHousingMapper ) session.getAttribute(
  -                    PluginManager.GOAL_MAPPER );
  -            JellyScriptHousing housing = mapper.getPluginHousing( getName() );
  -
  +            //GoalToJellyScriptHousingMapper mapper = ( 
GoalToJellyScriptHousingMapper ) session.getAttribute(
  +                    //PluginManager.GOAL_MAPPER );
  +            //JellyScriptHousing housing = mapper.getPluginHousing( getName() );
               MavenJellyContext context = housing.getProject().getContext();
   
               setContext( context );
  
  
  
  No                   revision
  No                   revision
  1.70.4.37 +8 -1      maven/src/java/org/apache/maven/plugin/PluginManager.java
  
  Index: PluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/plugin/PluginManager.java,v
  retrieving revision 1.70.4.36
  retrieving revision 1.70.4.37
  diff -u -r1.70.4.36 -r1.70.4.37
  --- PluginManager.java        10 Apr 2004 00:57:34 -0000      1.70.4.36
  +++ PluginManager.java        14 Apr 2004 01:03:44 -0000      1.70.4.37
  @@ -103,6 +103,7 @@
       public static final String GLOBAL_SESSION_KEY = "maven.session.global";
   
       public static final String PLUGIN_MANAGER = "maven.plugin.manager";
  +    public static final String PLUGIN_HOUSING = "maven.plugin.script.housing";
       public static final String GOAL_MAPPER = "maven.plugin.mapper";
   
       /** */
  @@ -872,7 +873,13 @@
               s = loadScript( jellyScriptHousing );
               jellyScriptHousing.setScript( s );
           }
  +        if ( context.getVariable( PLUGIN_HOUSING ) != null )
  +        {
  +            throw new IllegalStateException( "nested plugin housings" );
  +        }
  +        context.setVariable( PLUGIN_HOUSING, jellyScriptHousing );
           s.run( context, context.getXMLOutput() );
  +        context.removeVariable( PLUGIN_HOUSING );
       }
   
   }
  
  
  
  No                   revision
  No                   revision
  1.14.4.8  +1 -0      maven/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/maven/xdocs/changes.xml,v
  retrieving revision 1.14.4.7
  retrieving revision 1.14.4.8
  diff -u -r1.14.4.7 -r1.14.4.8
  --- changes.xml       12 Apr 2004 23:02:30 -0000      1.14.4.7
  +++ changes.xml       14 Apr 2004 01:03:44 -0000      1.14.4.8
  @@ -25,6 +25,7 @@
     </properties>
     <body>
       <release version="1.0RC3" date="in CVS">
  +      <action dev="brett" type="fix" issue="MPAPPSERVER-6">store current plugin 
housing and use that instead of looking up by goal name so that non-mapped goals know 
what housing they are in (eg goals defined in j:import'ed scripts)</action>
         <action dev="brett" type="fix" issue="MAVEN-1227">use correct new lines in 
maven -g output</action>
         <action dev="brett" type="fix" due-to="Shinsuke SUGAYA" 
issue="MAVEN-1050">Apply patch to use system encoding for project so that xdoc 
transformation of POM works on non-ISO8859-1 systems.</action>
         <action dev="brett" type="fix" due-to="David Zeleznik" 
issue="MAVEN-558">Improve error handling of HttpUtils</action>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to