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 2004/05/08 22:48:00 UTC

cvs commit: maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager AbstractPluginManager.java PlexusPluginManager.java PluginManager.java

jvanzyl     2004/05/08 13:48:00

  Modified:    maven-core/src/main/java/org/apache/maven/plugin/manager
                        AbstractPluginManager.java PlexusPluginManager.java
                        PluginManager.java
  Log:
  o we are not unpacking plugins, they are being used in situ. as such such
    we can remove all the complexity of requiring the expanding of plugins,
    all permissions crap that has to be dealt with, upgrading and everything
    else.
  
  Revision  Changes    Path
  1.5       +1 -111    maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/AbstractPluginManager.java
  
  Index: AbstractPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/AbstractPluginManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractPluginManager.java	7 May 2004 17:56:57 -0000	1.4
  +++ AbstractPluginManager.java	8 May 2004 20:48:00 -0000	1.5
  @@ -16,10 +16,7 @@
    * limitations under the License.
    */
   
  -import org.codehaus.plexus.util.Expand;
  -
   import java.io.File;
  -import java.io.IOException;
   import java.util.List;
   
   /**
  @@ -34,8 +31,6 @@
   {
       protected File pluginsDir;
   
  -    protected File unpackedPluginsDir;
  -
       protected String mavenHome;
   
       protected String mavenLocalHome;
  @@ -58,110 +53,5 @@
           {
               pluginsDir.mkdirs();
           }
  -
  -        unpackedPluginsDir = new File( new File( mavenLocalHome, "plugins" ), getId() );
  -
  -        if ( !unpackedPluginsDir.exists() )
  -        {
  -            unpackedPluginsDir.mkdirs();
  -        }
  -    }
  -
  -    public void initializePlugins( String mavenHome, String mavenLocalHome )
  -        throws Exception
  -    {
  -        this.mavenHome = mavenHome;
  -
  -        this.mavenLocalHome = mavenLocalHome;
  -
  -        setupPluginsDirectories();
  -
  -        File[] files = pluginsDir.listFiles();
  -
  -        // First we expand any JARs that contain plugins to the unpack directory.
  -        // This will be a different directory than the plugin jars
  -        // MAVEN_HOME_LOCAL / maven.home.local was set to a different directory
  -        // than MAVEN_HOME / maven.home.
  -
  -        if ( files != null )
  -        {
  -            for ( int i = 0; i < files.length; ++i )
  -            {
  -                // Only unpack the JAR if it hasn't been already, or is newer
  -                // than the plugin directory
  -                if ( files[i].getName().endsWith( ".jar" ) )
  -                {
  -                    String directory = files[i].getName();
  -
  -                    directory = directory.substring( 0, directory.indexOf( ".jar" ) );
  -
  -                    File unzipDir = new File( unpackedPluginsDir, directory );
  -
  -                    // if there's no directory, or the jar is newer, expand the jar
  -                    if ( unzipDir.exists() == false
  -                        || files[i].lastModified() > unzipDir.lastModified() )
  -                    {
  -                        File processed = getPluginProcessedMarker( unzipDir.getName() );
  -
  -                        if ( processed.exists() )
  -                        {
  -                            processed.delete();
  -                        }
  -
  -                        try
  -                        {
  -                            Expand unzipper = new Expand();
  -
  -                            unzipper.setSrc( files[i] );
  -
  -                            unzipper.setDest( unzipDir );
  -
  -                            unzipper.execute();
  -                        }
  -                        catch ( IOException e )
  -                        {
  -                            throw new Exception( "Unable to extract plugin: " + files[i], e );
  -                        }
  -                    }
  -                }
  -            }
  -
  -            // We need to get the directory listing again so that we
  -            // can process plugins that were just unpacked by the
  -            // above process. This time we're looking at the unpacked plugins.
  -            files = unpackedPluginsDir.listFiles();
  -
  -            // Process each of the directorties.
  -
  -            for ( int i = 0; i < files.length; ++i )
  -            {
  -                if ( files[i].isDirectory() )
  -                {
  -                    String directory = files[i].getName();
  -
  -                    loadPlugin( directory );
  -                }
  -            }
  -        }
  -    }
  -
  -    protected File getPluginProcessedMarker( String pluginName )
  -    {
  -        return new File( new File( unpackedPluginsDir, pluginName ), ".processed" );
  -    }
  -
  -    protected boolean isPluginProcessed( String pluginName )
  -    {
  -        return getPluginProcessedMarker( pluginName ).exists();
  -    }
  -
  -    protected File getUnpackedPluginDir( String pluginName )
  -    {
  -        return new File( getUnpackedPluginsDir(), pluginName );
  -    }
  -
  -    File getUnpackedPluginsDir()
  -    {
  -        return unpackedPluginsDir;
       }
   }
  
  
  
  1.2       +1 -7      maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PlexusPluginManager.java
  
  Index: PlexusPluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PlexusPluginManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PlexusPluginManager.java	8 May 2004 00:50:35 -0000	1.1
  +++ PlexusPluginManager.java	8 May 2004 20:48:00 -0000	1.2
  @@ -19,7 +19,6 @@
   import org.apache.maven.plugin.Plugin;
   import org.apache.maven.plugin.PluginExecutionRequest;
   import org.apache.maven.plugin.PluginExecutionResponse;
  -import org.apache.maven.plugin.manager.AbstractPluginManager;
   import org.apache.maven.plugin.manager.executor.PluginExecutor;
   import org.codehaus.plexus.PlexusConstants;
   import org.codehaus.plexus.PlexusContainer;
  @@ -37,11 +36,6 @@
       implements Contextualizable
   {
       private PlexusContainer container;
  -
  -    public void loadPlugin( String name )
  -        throws Exception
  -    {
  -    }
   
       public String getId()
       {
  
  
  
  1.7       +1 -7      maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManager.java
  
  Index: PluginManager.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- PluginManager.java	7 May 2004 17:56:57 -0000	1.6
  +++ PluginManager.java	8 May 2004 20:48:00 -0000	1.7
  @@ -37,10 +37,4 @@
       List getGoals();
   
       String getId();
  -
  -    void loadPlugin( String directory )
  -        throws Exception;
  -
  -    void initializePlugins( String mavenHome, String mavenLocalHome )
  -        throws Exception;
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org