dion        2004/01/02 22:45:40

  Modified:    src/java/org/apache/maven/jelly/tags/maven Tag:
                        MAVEN-1_0-BRANCH ParamCheck.java UserCheck.java
                        CopyResources.java PluginVarTag.java
               src/java/org/apache/maven/util Tag: MAVEN-1_0-BRANCH
                        DVSLFormatter.java
               src/test/java/org/apache/maven Tag: MAVEN-1_0-BRANCH
                        JAXPTest.java
               src/test/java/org/apache/maven/plugin Tag: MAVEN-1_0-BRANCH
                        PluginManagerTest.java
               src/java/org/apache/maven/cli Tag: MAVEN-1_0-BRANCH App.java
               src/java/org/apache/maven/project Tag: MAVEN-1_0-BRANCH
                        Project.java
               src/java/org/apache/maven Tag: MAVEN-1_0-BRANCH
                        MavenException.java
               src/java/org/apache/maven/plugin Tag: MAVEN-1_0-BRANCH
                        JellyPlugin.java
  Log:
  Remove my @authors
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.2.4.1   +1 -1      maven/src/java/org/apache/maven/jelly/tags/maven/ParamCheck.java
  
  Index: ParamCheck.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/ParamCheck.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- ParamCheck.java   14 Oct 2003 15:10:08 -0000      1.2
  +++ ParamCheck.java   3 Jan 2004 06:45:39 -0000       1.2.4.1
  @@ -61,7 +61,7 @@
   import org.apache.maven.jelly.tags.BaseTagSupport;
   
   /**
  - * @author dion
  + * A tag to check parameters are being passed correctly
    */
   public class ParamCheck extends BaseTagSupport
   {
  
  
  
  1.1.10.1  +1 -1      maven/src/java/org/apache/maven/jelly/tags/maven/UserCheck.java
  
  Index: UserCheck.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/UserCheck.java,v
  retrieving revision 1.1
  retrieving revision 1.1.10.1
  diff -u -r1.1 -r1.1.10.1
  --- UserCheck.java    31 Jul 2003 04:29:00 -0000      1.1
  +++ UserCheck.java    3 Jan 2004 06:45:39 -0000       1.1.10.1
  @@ -62,7 +62,7 @@
   import org.apache.maven.jelly.tags.BaseTagSupport;
   
   /**
  - * @author dion
  + * A tag to check if a user name is set.
    */
   public class UserCheck extends BaseTagSupport
   {
  
  
  
  1.2.4.1   +1 -2      
maven/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java
  
  Index: CopyResources.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/CopyResources.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- CopyResources.java        19 Aug 2003 04:25:39 -0000      1.2
  +++ CopyResources.java        3 Jan 2004 06:45:39 -0000       1.2.4.1
  @@ -73,7 +73,6 @@
   /**
    * A tag to copy resources to a given directory 
    * 
  - * @author dion
    * @version $Revision$
    */
   public class CopyResources extends BaseTagSupport
  
  
  
  1.1.4.2   +1 -1      
maven/src/java/org/apache/maven/jelly/tags/maven/PluginVarTag.java
  
  Index: PluginVarTag.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/java/org/apache/maven/jelly/tags/maven/PluginVarTag.java,v
  retrieving revision 1.1.4.1
  retrieving revision 1.1.4.2
  diff -u -r1.1.4.1 -r1.1.4.2
  --- PluginVarTag.java 10 Dec 2003 23:08:44 -0000      1.1.4.1
  +++ PluginVarTag.java 3 Jan 2004 06:45:39 -0000       1.1.4.2
  @@ -66,7 +66,7 @@
   import org.apache.maven.project.Project;
   
   /**
  - * @author dion
  + * A tag to retrieve values from plugins
    */
   public class PluginVarTag extends BaseTagSupport
   {
  
  
  
  No                   revision
  No                   revision
  1.2.4.1   +1 -2      maven/src/java/org/apache/maven/util/DVSLFormatter.java
  
  Index: DVSLFormatter.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/util/DVSLFormatter.java,v
  retrieving revision 1.2
  retrieving revision 1.2.4.1
  diff -u -r1.2 -r1.2.4.1
  --- DVSLFormatter.java        19 Aug 2003 04:31:38 -0000      1.2
  +++ DVSLFormatter.java        3 Jan 2004 06:45:39 -0000       1.2.4.1
  @@ -67,7 +67,6 @@
    * shouldn't be done in a DVSL stylesheet.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Pete Kazmier</a>
  - * @author <a href="mailto:[EMAIL PROTECTED]">dIon Gillard</a>
    * @version $Id$
    * @todo move to org.apache.maven.util or make a jelly tag
    */
  
  
  
  No                   revision
  No                   revision
  1.4.10.1  +0 -2      maven/src/test/java/org/apache/maven/JAXPTest.java
  
  Index: JAXPTest.java
  ===================================================================
  RCS file: /home/cvs/maven/src/test/java/org/apache/maven/JAXPTest.java,v
  retrieving revision 1.4
  retrieving revision 1.4.10.1
  diff -u -r1.4 -r1.4.10.1
  --- JAXPTest.java     13 Apr 2003 00:56:02 -0000      1.4
  +++ JAXPTest.java     3 Jan 2004 06:45:39 -0000       1.4.10.1
  @@ -64,8 +64,6 @@
   import org.xml.sax.helpers.XMLReaderFactory;
   
   /**
  - * @author dion
  - *
    * Tests to check JAXP is correctly configured and classes are being loaded
    */
   public class JAXPTest extends TestCase
  
  
  
  No                   revision
  No                   revision
  1.11.4.3  +0 -1      
maven/src/test/java/org/apache/maven/plugin/PluginManagerTest.java
  
  Index: PluginManagerTest.java
  ===================================================================
  RCS file: 
/home/cvs/maven/src/test/java/org/apache/maven/plugin/PluginManagerTest.java,v
  retrieving revision 1.11.4.2
  retrieving revision 1.11.4.3
  diff -u -r1.11.4.2 -r1.11.4.3
  --- PluginManagerTest.java    2 Dec 2003 03:58:35 -0000       1.11.4.2
  +++ PluginManagerTest.java    3 Jan 2004 06:45:39 -0000       1.11.4.3
  @@ -69,7 +69,6 @@
   import com.werken.forehead.Forehead;
   
   /**
  - * @author dion
    * @author Brett Porter <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>
    *
    */
  
  
  
  No                   revision
  No                   revision
  1.37.4.5  +1 -2      maven/src/java/org/apache/maven/cli/App.java
  
  Index: App.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/cli/App.java,v
  retrieving revision 1.37.4.4
  retrieving revision 1.37.4.5
  diff -u -r1.37.4.4 -r1.37.4.5
  --- App.java  31 Dec 2003 01:14:13 -0000      1.37.4.4
  +++ App.java  3 Jan 2004 06:45:39 -0000       1.37.4.5
  @@ -94,7 +94,6 @@
    * encapsulated in the MavenSession bean.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
  - * @author dIon Gillard
    *
    * @version $Id$
    *
  
  
  
  No                   revision
  No                   revision
  1.91.4.6  +1 -2      maven/src/java/org/apache/maven/project/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/project/Project.java,v
  retrieving revision 1.91.4.5
  retrieving revision 1.91.4.6
  diff -u -r1.91.4.5 -r1.91.4.6
  --- Project.java      3 Jan 2004 04:09:31 -0000       1.91.4.5
  +++ Project.java      3 Jan 2004 06:45:39 -0000       1.91.4.6
  @@ -91,7 +91,6 @@
   /**
    * @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Vincent Massol</a>
  - * @author <a href="mailto:[EMAIL PROTECTED]">dIon Gillard</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Glenn McAllister</a>
    *
    * @version $Id$
  
  
  
  No                   revision
  No                   revision
  1.4.10.1  +1 -2      maven/src/java/org/apache/maven/MavenException.java
  
  Index: MavenException.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/MavenException.java,v
  retrieving revision 1.4
  retrieving revision 1.4.10.1
  diff -u -r1.4 -r1.4.10.1
  --- MavenException.java       12 Apr 2003 00:02:05 -0000      1.4
  +++ MavenException.java       3 Jan 2004 06:45:39 -0000       1.4.10.1
  @@ -63,7 +63,6 @@
    * The base class for all exceptions thrown by MavenSession. Taken liberally from
    * <a href="http://jakarta.apache.org/ant/";>Ant's</a> BuildException
    *
  - * @author dion
    * @version $Id$
    */
   public class MavenException extends Exception
  
  
  
  No                   revision
  No                   revision
  1.3.4.3   +296 -297  maven/src/java/org/apache/maven/plugin/Attic/JellyPlugin.java
  
  Index: JellyPlugin.java
  ===================================================================
  RCS file: /home/cvs/maven/src/java/org/apache/maven/plugin/Attic/JellyPlugin.java,v
  retrieving revision 1.3.4.2
  retrieving revision 1.3.4.3
  diff -u -r1.3.4.2 -r1.3.4.3
  --- JellyPlugin.java  2 Dec 2003 03:59:06 -0000       1.3.4.2
  +++ JellyPlugin.java  3 Jan 2004 06:45:40 -0000       1.3.4.3
  @@ -1,297 +1,296 @@
  -package org.apache.maven.plugin;
  -
  -/* ====================================================================
  - * The Apache Software License, Version 1.1
  - *
  - * Copyright (c) 2001 The Apache Software Foundation.  All rights
  - * reserved.
  - *
  - * Redistribution and use in source and binary forms, with or without
  - * modification, are permitted provided that the following conditions
  - * are met:
  - *
  - * 1. Redistributions of source code must retain the above copyright
  - *    notice, this list of conditions and the following disclaimer.
  - *
  - * 2. Redistributions in binary form must reproduce the above copyright
  - *    notice, this list of conditions and the following disclaimer in
  - *    the documentation and/or other materials provided with the
  - *    distribution.
  - *
  - * 3. The end-user documentation included with the redistribution,
  - *    if any, must include the following acknowledgment:
  - *       "This product includes software developed by the
  - *        Apache Software Foundation (http://www.apache.org/)."
  - *    Alternately, this acknowledgment may appear in the software itself,
  - *    if and wherever such third-party acknowledgments normally appear.
  - *
  - * 4. The names "Apache" and "Apache Software Foundation" and
  - *    "Apache Maven" must not be used to endorse or promote products
  - *    derived from this software without prior written permission. For
  - *    written permission, please contact [EMAIL PROTECTED]
  - *
  - * 5. Products derived from this software may not be called "Apache",
  - *    "Apache Maven", nor may "Apache" appear in their name, without
  - *    prior written permission of the Apache Software Foundation.
  - *
  - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  - * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  - * SUCH DAMAGE.
  - * ====================================================================
  - *
  - * This software consists of voluntary contributions made by many
  - * individuals on behalf of the Apache Software Foundation.  For more
  - * information on the Apache Software Foundation, please see
  - * <http://www.apache.org/>.
  - *
  - * ====================================================================
  - */
  -
  -import com.werken.forehead.ForeheadClassLoader;
  -import org.apache.commons.jelly.Script;
  -import org.apache.commons.logging.Log;
  -import org.apache.commons.logging.LogFactory;
  -import org.apache.maven.MavenException;
  -import org.apache.maven.MavenUtils;
  -import org.apache.maven.jelly.JellyUtils;
  -import org.apache.maven.jelly.MavenJellyContext;
  -import org.apache.maven.project.Project;
  -import org.apache.maven.util.Expand;
  -
  -import java.io.File;
  -import java.io.IOException;
  -
  -/**
  - * A runtime view of a plugin written in Jelly.  
  - * 
  - * @author dion
  - * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
  - * @version $Id$
  - * @todo cleanup needed.
  - */
  -final class JellyPlugin
  -{
  -    /** Logger. */
  -    private static final Log log = LogFactory.getLog( JellyPlugin.class );
  -
  -    /** The plugin ID. This will be the artifact ID + version (not a usual ID.
  -     * @todo rename? [RC2]
  -     */
  -    private final String id;
  -
  -    /** the jar file the plugin was extracted from. @todo [RC2] - needed? */
  -    private File jarFile;
  -    
  -    /** the directory to unpack the plugin into. @todo [RC2] - needed? */
  -    private File unpackDirectory;
  -        
  -    /** the directory the plugin is installed into. @todo [RC2] - needed? */
  -    private File directory;
  -
  -    /** the project.xml file for the plugin */
  -    private File descriptor;
  -
  -    /** the script for this plugin */
  -    private File scriptFile;
  -
  -    /** Maven project for the plugin */
  -    private Project project;
  -
  -    /** compiled script */
  -    private Script compiledScript;
  -
  -    /** classloader for the plugin. @todo just lazy at the moment, refactor */
  -    private ForeheadClassLoader parentClassLoader;
  -
  -    /**
  -     * Constructor.
  -     * @param pluginFile the JAR file to read the plugin from.
  -     */
  -    JellyPlugin(File pluginFile)
  -    {
  -        String directory = pluginFile.getName();
  -        int index = directory.indexOf( ".jar" );
  -        if ( index >= 0 ) 
  -        {
  -            this.id = directory.substring( 0, index );
  -            this.jarFile = pluginFile;
  -        }
  -        else
  -        {
  -            this.id = directory;
  -        }
  -   }
  -
  -    /**
  -     * Get the plugin identifier.
  -     * @return the plugin identifier
  -     */
  -    String getId()
  -    {
  -        return id;
  -    }
  -
  -    /**
  -     * Unpack the plugin.
  -     * @param unpackDirectory the directory to unpack the plugin to
  -     * @todo [RC2] refactor with new parameter
  -     * @throws MavenException if there was a problem unpacking
  -     */
  -    void unpack( File unpackDirectory ) throws MavenException
  -    {
  -        if ( jarFile == null )
  -        {
  -            return;
  -        }
  -
  -        File unzipDir = new File( unpackDirectory, id );
  -
  -        // if there's no directory, or the jar is newer, expand the jar
  -        if ( !unzipDir.exists() || ( jarFile.lastModified() > 
unzipDir.lastModified() ) )
  -        {
  -            if (log.isDebugEnabled())
  -            {
  -                log.debug( "Unpacking '" + id + "' plugin to directory --> " + 
unzipDir.getAbsolutePath() );
  -            }
  -            /** TODO [RC2] - reinstate for cache: cacheManager.invalidateCache(id); 
*/
  -
  -            try
  -            {
  -                Expand unzipper = new Expand();
  -                unzipper.setSrc( jarFile );
  -                unzipper.setDest( unzipDir );
  -                unzipper.execute();
  -            }
  -            catch ( IOException e )
  -            {
  -                throw new MavenException( "Unable to extract plugin: " + jarFile, e 
);
  -            }
  -        }
  -    }
  -    
  -    /**
  -     * Load the plugin. 
  -     * @throws Exception the exception
  -     * @todo [RC2] this is ugly
  -     */
  -    void load() throws Exception
  -    {
  -        log.debug( "Loading plugin '" + id + "'" );
  -    
  -        project = MavenUtils.getProject( getDescriptor(), null, false );
  -        project.verifyDependencies();
  -        parentClassLoader.addURL(directory.toURL());
  -        PluginManager.processDependencies(project, parentClassLoader);
  -    }
  -    
  -    /**
  -     * @return the install directory of the plugin
  -     */
  -    public File getDirectory()
  -    {
  -        if (directory == null && unpackDirectory != null)
  -        {
  -            directory = new File(unpackDirectory, id);
  -        }
  -        return directory;
  -    }
  -
  -    /**
  -     * @param aDirectory the install directory of the plugin
  -     */
  -    public void setDirectory(File aDirectory)
  -    {
  -        directory = aDirectory;
  -    }
  -
  -    /**
  -     * @return true if a plugin.jelly exists in the directory
  -     */
  -    public boolean hasScript()
  -    {
  -        return getScriptFile().exists();        
  -    }
  -    
  -    /**
  -     * @return the jelly script 
  -     */
  -    public File getScriptFile()
  -    {
  -        if (scriptFile == null) {
  -            scriptFile = new File( getDirectory(), "plugin.jelly");
  -        }
  -        return scriptFile;
  -    }
  -    
  -    /**
  -     * @return the project descriptor for this plugin 
  -     */
  -    public File getDescriptor()
  -    {
  -        if (descriptor == null) {
  -            descriptor = new File( getDirectory(), "project.xml");
  -        }
  -        return descriptor;
  -    }
  -
  -    /**
  -     * @return the maven project for this plugin
  -     */
  -    public Project getProject()
  -    {
  -        return project;
  -    }
  -
  -    /**
  -     * @param project a maven project
  -     */
  -    public void setProject(Project project)
  -    {
  -        this.project = project;
  -    }
  -
  -    /**
  -     * Get a compiled plugin script for the plugin.
  -     * @param context the context to compile using
  -     * @return the script
  -     * @throws Exception FIXME bad
  -     */
  -    public Script getCompiledScriptFor(MavenJellyContext context) throws Exception
  -    {
  -        if (hasScript())
  -        {
  -            compiledScript = JellyUtils.compileScript(getScriptFile(), context);
  -        }
  -        return compiledScript;
  -    }
  -
  -    /**
  -     * @param file the jar file containing the plugin
  -     */
  -    public void setJarFile(File file)
  -    {
  -        jarFile = file;
  -    }
  -
  -    /**
  -     * @param file the directory to unpack the plugin into
  -     */
  -    public void setUnpackDirectory(File file)
  -    {
  -        unpackDirectory = file;
  -    }
  -
  -    public void setParentClassLoader(ForeheadClassLoader loader)
  -    {
  -        parentClassLoader = loader;
  -    }
  -}
  +package org.apache.maven.plugin;
  +
  +/* ====================================================================
  + * The Apache Software License, Version 1.1
  + *
  + * Copyright (c) 2001 The Apache Software Foundation.  All rights
  + * reserved.
  + *
  + * Redistribution and use in source and binary forms, with or without
  + * modification, are permitted provided that the following conditions
  + * are met:
  + *
  + * 1. Redistributions of source code must retain the above copyright
  + *    notice, this list of conditions and the following disclaimer.
  + *
  + * 2. Redistributions in binary form must reproduce the above copyright
  + *    notice, this list of conditions and the following disclaimer in
  + *    the documentation and/or other materials provided with the
  + *    distribution.
  + *
  + * 3. The end-user documentation included with the redistribution,
  + *    if any, must include the following acknowledgment:
  + *       "This product includes software developed by the
  + *        Apache Software Foundation (http://www.apache.org/)."
  + *    Alternately, this acknowledgment may appear in the software itself,
  + *    if and wherever such third-party acknowledgments normally appear.
  + *
  + * 4. The names "Apache" and "Apache Software Foundation" and
  + *    "Apache Maven" must not be used to endorse or promote products
  + *    derived from this software without prior written permission. For
  + *    written permission, please contact [EMAIL PROTECTED]
  + *
  + * 5. Products derived from this software may not be called "Apache",
  + *    "Apache Maven", nor may "Apache" appear in their name, without
  + *    prior written permission of the Apache Software Foundation.
  + *
  + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  + * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  + * SUCH DAMAGE.
  + * ====================================================================
  + *
  + * This software consists of voluntary contributions made by many
  + * individuals on behalf of the Apache Software Foundation.  For more
  + * information on the Apache Software Foundation, please see
  + * <http://www.apache.org/>.
  + *
  + * ====================================================================
  + */
  +
  +import com.werken.forehead.ForeheadClassLoader;
  +import org.apache.commons.jelly.Script;
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
  +import org.apache.maven.MavenException;
  +import org.apache.maven.MavenUtils;
  +import org.apache.maven.jelly.JellyUtils;
  +import org.apache.maven.jelly.MavenJellyContext;
  +import org.apache.maven.project.Project;
  +import org.apache.maven.util.Expand;
  +
  +import java.io.File;
  +import java.io.IOException;
  +
  +/**
  + * A runtime view of a plugin written in Jelly.  
  + * 
  + * @author <a href="mailto:[EMAIL PROTECTED]">Brett Porter</a>
  + * @version $Id$
  + * @todo cleanup needed.
  + */
  +final class JellyPlugin
  +{
  +    /** Logger. */
  +    private static final Log log = LogFactory.getLog( JellyPlugin.class );
  +
  +    /** The plugin ID. This will be the artifact ID + version (not a usual ID.
  +     * @todo rename? [RC2]
  +     */
  +    private final String id;
  +
  +    /** the jar file the plugin was extracted from. @todo [RC2] - needed? */
  +    private File jarFile;
  +    
  +    /** the directory to unpack the plugin into. @todo [RC2] - needed? */
  +    private File unpackDirectory;
  +        
  +    /** the directory the plugin is installed into. @todo [RC2] - needed? */
  +    private File directory;
  +
  +    /** the project.xml file for the plugin */
  +    private File descriptor;
  +
  +    /** the script for this plugin */
  +    private File scriptFile;
  +
  +    /** Maven project for the plugin */
  +    private Project project;
  +
  +    /** compiled script */
  +    private Script compiledScript;
  +
  +    /** classloader for the plugin. @todo just lazy at the moment, refactor */
  +    private ForeheadClassLoader parentClassLoader;
  +
  +    /**
  +     * Constructor.
  +     * @param pluginFile the JAR file to read the plugin from.
  +     */
  +    JellyPlugin(File pluginFile)
  +    {
  +        String directory = pluginFile.getName();
  +        int index = directory.indexOf( ".jar" );
  +        if ( index >= 0 ) 
  +        {
  +            this.id = directory.substring( 0, index );
  +            this.jarFile = pluginFile;
  +        }
  +        else
  +        {
  +            this.id = directory;
  +        }
  +   }
  +
  +    /**
  +     * Get the plugin identifier.
  +     * @return the plugin identifier
  +     */
  +    String getId()
  +    {
  +        return id;
  +    }
  +
  +    /**
  +     * Unpack the plugin.
  +     * @param unpackDirectory the directory to unpack the plugin to
  +     * @todo [RC2] refactor with new parameter
  +     * @throws MavenException if there was a problem unpacking
  +     */
  +    void unpack( File unpackDirectory ) throws MavenException
  +    {
  +        if ( jarFile == null )
  +        {
  +            return;
  +        }
  +
  +        File unzipDir = new File( unpackDirectory, id );
  +
  +        // if there's no directory, or the jar is newer, expand the jar
  +        if ( !unzipDir.exists() || ( jarFile.lastModified() > 
unzipDir.lastModified() ) )
  +        {
  +            if (log.isDebugEnabled())
  +            {
  +                log.debug( "Unpacking '" + id + "' plugin to directory --> " + 
unzipDir.getAbsolutePath() );
  +            }
  +            /** TODO [RC2] - reinstate for cache: cacheManager.invalidateCache(id); 
*/
  +
  +            try
  +            {
  +                Expand unzipper = new Expand();
  +                unzipper.setSrc( jarFile );
  +                unzipper.setDest( unzipDir );
  +                unzipper.execute();
  +            }
  +            catch ( IOException e )
  +            {
  +                throw new MavenException( "Unable to extract plugin: " + jarFile, e 
);
  +            }
  +        }
  +    }
  +    
  +    /**
  +     * Load the plugin. 
  +     * @throws Exception the exception
  +     * @todo [RC2] this is ugly
  +     */
  +    void load() throws Exception
  +    {
  +        log.debug( "Loading plugin '" + id + "'" );
  +    
  +        project = MavenUtils.getProject( getDescriptor(), null, false );
  +        project.verifyDependencies();
  +        parentClassLoader.addURL(directory.toURL());
  +        PluginManager.processDependencies(project, parentClassLoader);
  +    }
  +    
  +    /**
  +     * @return the install directory of the plugin
  +     */
  +    public File getDirectory()
  +    {
  +        if (directory == null && unpackDirectory != null)
  +        {
  +            directory = new File(unpackDirectory, id);
  +        }
  +        return directory;
  +    }
  +
  +    /**
  +     * @param aDirectory the install directory of the plugin
  +     */
  +    public void setDirectory(File aDirectory)
  +    {
  +        directory = aDirectory;
  +    }
  +
  +    /**
  +     * @return true if a plugin.jelly exists in the directory
  +     */
  +    public boolean hasScript()
  +    {
  +        return getScriptFile().exists();        
  +    }
  +    
  +    /**
  +     * @return the jelly script 
  +     */
  +    public File getScriptFile()
  +    {
  +        if (scriptFile == null) {
  +            scriptFile = new File( getDirectory(), "plugin.jelly");
  +        }
  +        return scriptFile;
  +    }
  +    
  +    /**
  +     * @return the project descriptor for this plugin 
  +     */
  +    public File getDescriptor()
  +    {
  +        if (descriptor == null) {
  +            descriptor = new File( getDirectory(), "project.xml");
  +        }
  +        return descriptor;
  +    }
  +
  +    /**
  +     * @return the maven project for this plugin
  +     */
  +    public Project getProject()
  +    {
  +        return project;
  +    }
  +
  +    /**
  +     * @param project a maven project
  +     */
  +    public void setProject(Project project)
  +    {
  +        this.project = project;
  +    }
  +
  +    /**
  +     * Get a compiled plugin script for the plugin.
  +     * @param context the context to compile using
  +     * @return the script
  +     * @throws Exception FIXME bad
  +     */
  +    public Script getCompiledScriptFor(MavenJellyContext context) throws Exception
  +    {
  +        if (hasScript())
  +        {
  +            compiledScript = JellyUtils.compileScript(getScriptFile(), context);
  +        }
  +        return compiledScript;
  +    }
  +
  +    /**
  +     * @param file the jar file containing the plugin
  +     */
  +    public void setJarFile(File file)
  +    {
  +        jarFile = file;
  +    }
  +
  +    /**
  +     * @param file the directory to unpack the plugin into
  +     */
  +    public void setUnpackDirectory(File file)
  +    {
  +        unpackDirectory = file;
  +    }
  +
  +    public void setParentClassLoader(ForeheadClassLoader loader)
  +    {
  +        parentClassLoader = loader;
  +    }
  +}
  
  
  

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

Reply via email to