// Jelly

    /**
     * A list of the plugin context for the plugins that have been loaded for this project.
     * This allows inter plugin communication. Needs some fleshing out.
     */
    private Map pluginContexts = new HashMap();

    /**
     * Add a plugin context to the list of project's plugin contexts.
     *
     * @param pluginId Plugin id.
     * @param pluginContext The plugin context created when loading the plugin against this
     *        project's context.
     */
    public void addPluginContext( String pluginId, MavenJellyContext pluginContext )
    {
        pluginContexts.put( Project.standardToLegacyId( pluginId ), pluginContext );
    }

    /**
     * Get the plugin context using the plugin name.
     *
     * @param pluginId Plugin name.
     * @return The plugin context create for the named plugin when it was loaded for
     *         this project.
     */
    public MavenJellyContext getPluginContext( String pluginId )
    {
        return (MavenJellyContext) pluginContexts.get( pluginId );
    }

    /**
     * Get plugin context for this project.
     *
     * @return All the plugin context created for this project.
     */
    public Map getPluginContexts()
    {
        return pluginContexts;
    }

    /**
     * Set the context attribute.
     *
     * @param context
     */
    public void setContext( MavenJellyContext context )
    {
        this.context = context;
    }

    /**
     * Get the context attribute.
     *
     * @return The
     */
    public MavenJellyContext getContext()
    {
        return context;
    }

    /**
     * Initialise the jelly script that drives the build
     *
     * @throws Exception when any error occurs
     */
    public void initializeDriver()
        throws Exception
    {
        // this is working correctly and the driver can be initialized
        // for a project then we can go way and initialize other projects
        // come back in the reactor and the values set are still correct.

        InputStream driverInputStream = getResourceAsStream( "driver.jelly" );

        JellyUtils.runScript( driverInputStream,
                              null,
                              getContext(),
                              getContext().getXMLOutput() );
    }

    /**
     * Return an InputStream found in the classpath. Used
     *  specifically to find resources stored in the maven.jar
     *
     * @param name Name of the resource to find.
     * @return InputStream Found the found resource.
     * @throws Exception If an error occurs while trying to retreive the
     * named resource.
     */
    private InputStream getResourceAsStream( String name )
        throws Exception
    {
        return Project.class.getClassLoader().getResourceAsStream( name );
    }

   /**
     * Load a Jelly script for this project.
     *
     * @param jellyScript Jelly script to run for this project's use.
     * @throws Exception If an error occurs while running Jelly script.
     */
    public void loadJellyScript( File jellyScript )
        throws Exception
    {
        getContext().getMaven().loadJellyScript( jellyScript, this );
    }

// ANT

    /** Could we somehow manage to get rid of this. */
    private GrantProject grantProject;

    /**
     * Set the grantProject attribute.
     *
     * @param grantProject
     */
    public void setAntProject( GrantProject grantProject )
    {
        this.grantProject = grantProject;
    }

    /**
     * Get the grantProject attribute.
     *
     * @return The
     */
    public GrantProject getAntProject()
    {
        return grantProject;
    }
