You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2003/02/04 23:28:59 UTC

cvs commit: jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven PomTag.java

jvanzyl     2003/02/04 14:28:59

  Modified:    src/java/org/apache/maven/jelly/tags/maven PomTag.java
  Log:
  o The handling for getting the parent context was just plain wrong. we simply need the context held by jelly to be the parent context for the project context created. this holds the values like the online mode that we need.
  
  Revision  Changes    Path
  1.7       +9 -20     jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/PomTag.java
  
  Index: PomTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/jelly/tags/maven/PomTag.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PomTag.java	29 Jan 2003 23:54:50 -0000	1.6
  +++ PomTag.java	4 Feb 2003 22:28:59 -0000	1.7
  @@ -73,7 +73,7 @@
    * @version $Id$
    */
   public class PomTag
  -     extends BaseTagSupport
  +    extends BaseTagSupport
   {
       /** MavenSession project descriptor. */
       private File projectDescriptor;
  @@ -104,7 +104,7 @@
       /**
        * Perform functionality provided by the tag
        * @param output the place to write output
  -     * @throws Exception when the projectDescriptor attribute is missing, or
  +     * @throws JellyTagException when the projectDescriptor attribute is missing, or
        *      another error occurs
        */
       public void doTag( XMLOutput output )
  @@ -122,27 +122,16 @@
               throw new MissingAttributeException( "var" );
           }
   
  -        // If we are being run in the context of a plugin then use the plugin
  -        // context as a parent so that we have necessary values like the online
  -        // switch, emacs mode. This allows us to use the project created this way
  -        // just like any other project without any surprises.
  -        MavenJellyContext parentContext = null;
  -        if ( getContext().getVariable( "plugin" ) != null )
  -        {
  -            Project plugin = (Project) getContext().getVariable( "plugin" );
  -            parentContext = plugin.getContext();
  -        }
  -
           try
           {
  -            context.setVariable( var, 
  -                MavenUtils.getProject( projectDescriptor,
  -                                       parentContext,
  -                                       false ) );
  +            context.setVariable( var,
  +                                 MavenUtils.getProject( projectDescriptor,
  +                                                        getMavenContext(),
  +                                                        false ) );
           }
  -        catch (Exception anException)
  +        catch ( Exception e )
           {
  -            throw new JellyTagException("error getting project", anException);
  +            throw new JellyTagException( "error getting project", e );
           }
       }
   }