Maven 1.x Plugin Plugin

Plugins on a per-user basis

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Linux (Debian), Maven 1.1
  • Number of attachments :
    1

Description

Problem:

When I try to compile Geronimo, it fails when trying to install its plugin into the $MAVEN_HOME directory, since it is a shared installation in /usr/local/maven-1.1. It does not install the plugins on a per-user basis to my maven local directory (~/.maven). Is this the intended behaviour?

Analysis:

In the org.apache.maven.plugin.PluginManager class, which is called for plugin:install-now, the plugin is installed in the user plugins dir, as we may check through the following code:

if ( cache )

{ FileUtils.copyFileToDirectory( file, userPluginsDir ); cacheManager.registerPlugin( pluginName, housing ); housing.parse( cacheManager ); cacheManager.saveCache( unpackedPluginsDir ); }

Since I am not sure if the behaviour was intentional, I would like to know your opinion about that.

From the point of view that there is an inconsistent behaviour, I will attach a patch that changes plugin:install to do the same as plugin:install-now: install in the user directory. With this patch, current repository version of Apache Geronimo works properly.

Concerning plugin removal, the code already check both directories (global and user), as you may check here (plugin/plugin.jelly):

<define:tag name="uninstall">
<ant:delete verbose="false" failonerror="false">
<ant:fileset dir="${maven.plugin.dir}">
<ant:include name="${name}-*.jar" />
</ant:fileset>
<ant:fileset dir="${maven.plugin.user.dir}">
<ant:include name="${name}-*.jar" />
</ant:fileset>
</ant:delete>

Thank you!

Activity

Hide
Rodrigo S. de Castro added a comment -

Apply it using the following command line:

patch -p1 -i ../maven-plugin-plugin-installation.patch

Show
Rodrigo S. de Castro added a comment - Apply it using the following command line: patch -p1 -i ../maven-plugin-plugin-installation.patch
Hide
Brett Porter added a comment -

Yes, the plugin should have a way to install for a user. I have worked on this, but not yet been able to find the correct semantics.

I don't believe that plugin:install should be changed to do this immediately because it may break behaviour expected by someone.

We have someone working with geronimo at the moment that may be able to help with this.

Show
Brett Porter added a comment - Yes, the plugin should have a way to install for a user. I have worked on this, but not yet been able to find the correct semantics. I don't believe that plugin:install should be changed to do this immediately because it may break behaviour expected by someone. We have someone working with geronimo at the moment that may be able to help with this.
Hide
Lukas Theussl added a comment -

Can't we simply add a property to choose whether plugins get installed in maven.plugin.dir or maven.plugin.user.dir?

Show
Lukas Theussl added a comment - Can't we simply add a property to choose whether plugins get installed in maven.plugin.dir or maven.plugin.user.dir?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: