You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ev...@apache.org on 2004/07/01 22:20:37 UTC
cvs commit: maven/src/java/org/apache/maven/plugin PluginManager.java
evenisse 2004/07/01 13:20:37
Modified: src/java/org/apache/maven/plugin Tag: MAVEN-1_0-BRANCH
PluginManager.java
Log:
[MAVEN-1352] Add a message to user when the plugins dirs reading generate an error.
Revision Changes Path
No revision
No revision
1.70.4.49 +13 -2 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.48
retrieving revision 1.70.4.49
diff -u -r1.70.4.48 -r1.70.4.49
--- PluginManager.java 28 Jun 2004 09:39:09 -0000 1.70.4.48
+++ PluginManager.java 1 Jul 2004 20:20:36 -0000 1.70.4.49
@@ -241,7 +241,18 @@
// allow further customisation via a profile descriptor.
Map pluginFiles = getPluginFiles( pluginsDir, true );
- pluginFiles.putAll( getPluginFiles( userPluginsDir, false ) );
+ Map userPluginFiles = getPluginFiles( userPluginsDir, false );
+
+ if ( !Collections.EMPTY_MAP.equals( userPluginFiles ) &&
+ Collections.EMPTY_MAP.hashCode() == userPluginFiles.hashCode() )
+ {
+ pluginFiles.putAll( userPluginFiles );
+ }
+ else
+ {
+ throw new MavenException( "Maven was badly installed. Please reinstall it." );
+ }
+
Map pluginDirs = expandPluginFiles( pluginFiles );
cacheManager.loadCache( unpackedPluginsDir );
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: cvs commit: maven/src/java/org/apache/maven/plugin PluginManager.java
Posted by Emmanuel Venisse <em...@venisse.net>.
----- Original Message -----
From: "Brett Porter" <br...@apache.org>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Friday, July 02, 2004 2:33 AM
Subject: Re: cvs commit: maven/src/java/org/apache/maven/plugin
PluginManager.java
> Emmanuel,
>
> This is checking the wrong directory - the user plugin directory is
usually
> empty (ie jars in $MAVEN_HOME_LOCAL/plugins). It should be checking the
first
> one: pluginFiles. (that is $MAVEN_HOME/plugins)
>
> Also, wouldn't userPluginFiles.isEmpty() be much easier? :)
Done.
>
> - Brett
>
> > Map pluginFiles = getPluginFiles( pluginsDir, true );
> > - pluginFiles.putAll( getPluginFiles( userPluginsDir,
false ) );
> > + Map userPluginFiles = getPluginFiles( userPluginsDir,
false );
> > +
> > + if ( !Collections.EMPTY_MAP.equals( userPluginFiles ) &&
> > + Collections.EMPTY_MAP.hashCode() ==
userPluginFiles.hashCode()
> > )
> > + {
> > + pluginFiles.putAll( userPluginFiles );
> > + }
> > + else
> > + {
> > + throw new MavenException( "Maven was badly installed.
Please
> > reinstall it." );
> > + }
> > +
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: cvs commit: maven/src/java/org/apache/maven/plugin PluginManager.java
Posted by Brett Porter <br...@apache.org>.
Emmanuel,
This is checking the wrong directory - the user plugin directory is usually
empty (ie jars in $MAVEN_HOME_LOCAL/plugins). It should be checking the first
one: pluginFiles. (that is $MAVEN_HOME/plugins)
Also, wouldn't userPluginFiles.isEmpty() be much easier? :)
- Brett
> Map pluginFiles = getPluginFiles( pluginsDir, true );
> - pluginFiles.putAll( getPluginFiles( userPluginsDir, false ) );
> + Map userPluginFiles = getPluginFiles( userPluginsDir, false );
> +
> + if ( !Collections.EMPTY_MAP.equals( userPluginFiles ) &&
> + Collections.EMPTY_MAP.hashCode() == userPluginFiles.hashCode()
> )
> + {
> + pluginFiles.putAll( userPluginFiles );
> + }
> + else
> + {
> + throw new MavenException( "Maven was badly installed. Please
> reinstall it." );
> + }
> +
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org