Maven Integration for Eclipse

Plugin fail to initialize when default maven repository folder is not available

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.0.7
  • Fix Version/s: 0.0.10
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP Professional SP2
    JSE v1.5.0-06
    Eclipse 3.2RC4
  • Number of attachments :
    1

Description

This is this error when I try to go to the Maven2 preferences :

Plug-in org.maven.ide.eclipse was unable to load class org.maven.ide.eclipse.preferences.Maven2PreferencePage.

As well, I an not able to associate a project with maven2 when using the RMB context menu for a project . I get a popup window with the following

The chosen operation is not currently available

Issue Links

Activity

Hide
Eugene Kuleshov added a comment -

Please try with version 0.0.9. If it won't work please check default m2 repository folder "Documents and Settings/<user name>/.m2 make sure that this directory exist and settings.xml (if it is there) is a valid xml.

Show
Eugene Kuleshov added a comment - Please try with version 0.0.9. If it won't work please check default m2 repository folder "Documents and Settings/<user name>/.m2 make sure that this directory exist and settings.xml (if it is there) is a valid xml.
Hide
Matthijs Wensveen added a comment -

Same problem here on linux using eclipse 3.1.2 with m2eclipse version 0.0.9.
Weird thing is that it worked after I installed 0.0.5 first and then 0.0.9. Probably loads the pref page from a cache or something.
Looking in the jar I found that the .class file looks to be a text file. Could this be the problem?

Show
Matthijs Wensveen added a comment - Same problem here on linux using eclipse 3.1.2 with m2eclipse version 0.0.9. Weird thing is that it worked after I installed 0.0.5 first and then 0.0.9. Probably loads the pref page from a cache or something. Looking in the jar I found that the .class file looks to be a text file. Could this be the problem?
Hide
Eugene Kuleshov added a comment -

It has nothing to do with plugin classes. As I said, plugin is trying to initialize embedder on startup and if that fail plugin is not initialized. The reason that embedder fail is that repository directory is not there. It is possible though, that behaviour of either embedder or plugin had been changed since 0.0.5 version.

Show
Eugene Kuleshov added a comment - It has nothing to do with plugin classes. As I said, plugin is trying to initialize embedder on startup and if that fail plugin is not initialized. The reason that embedder fail is that repository directory is not there. It is possible though, that behaviour of either embedder or plugin had been changed since 0.0.5 version.
Hide
Philippe Herlin added a comment -

Hi Eugene.
I have the same issue and I understand what you are saying.
Does that mean we cannot use a local repository that is not "Documents and Settings/<user name>/.m2" ?

In particular, I have configured a local repository at "c:/usr/repositories/maven" instead and configured the Maven settings.xml file accordingly.
Command line Maven works perfectly with this setting.

Regards
Philippe.

Show
Philippe Herlin added a comment - Hi Eugene. I have the same issue and I understand what you are saying. Does that mean we cannot use a local repository that is not "Documents and Settings/<user name>/.m2" ? In particular, I have configured a local repository at "c:/usr/repositories/maven" instead and configured the Maven settings.xml file accordingly. Command line Maven works perfectly with this setting. Regards Philippe.
Hide
Martin Goulet added a comment -

The problem is not with the plugin. What you need to keep in mind is that the plugin is built on top on Maven. So you need to install Maven first and run it at least one time from the command line so that the "Documents and Settings/<username>/.m2" directory is created. Once that is done, go back in Eclipse and everything will be ok.

MG

Show
Martin Goulet added a comment - The problem is not with the plugin. What you need to keep in mind is that the plugin is built on top on Maven. So you need to install Maven first and run it at least one time from the command line so that the "Documents and Settings/<username>/.m2" directory is created. Once that is done, go back in Eclipse and everything will be ok. MG
Hide
Tim Hedger added a comment -

Having just come across the same problem I can see where both Phillipe and Martin are coming from on this issue. The plugin does work fine; you can use a local repository, but the problem is you have to put the settings.xml config file for Maven in a specific place (the location specified by the property ${user.home}/.m2/settings.xml) before you can run the plugin in Eclipse to specify where you want the repository to be. The issue from a maven perspective being that the master configuration for maven is in the conf subdirectory under the maven installation. So if, as I do, you have your configuration for your repository and proxy etc in that file (e.g. c:\maven-2.0.4\conf\settings.xml) the Eclipse plugin doesn't look there - it insists that the settings.xml file in under ${user.home} - so in my case I have to duplicate it. When I do that it works fine.
I think a worthwhile enhancement to the plugin would be to look for a settings.xml file in the conf directory under the maven installation and use that in preference - as maven itself does.

Show
Tim Hedger added a comment - Having just come across the same problem I can see where both Phillipe and Martin are coming from on this issue. The plugin does work fine; you can use a local repository, but the problem is you have to put the settings.xml config file for Maven in a specific place (the location specified by the property ${user.home}/.m2/settings.xml) before you can run the plugin in Eclipse to specify where you want the repository to be. The issue from a maven perspective being that the master configuration for maven is in the conf subdirectory under the maven installation. So if, as I do, you have your configuration for your repository and proxy etc in that file (e.g. c:\maven-2.0.4\conf\settings.xml) the Eclipse plugin doesn't look there - it insists that the settings.xml file in under ${user.home} - so in my case I have to duplicate it. When I do that it works fine. I think a worthwhile enhancement to the plugin would be to look for a settings.xml file in the conf directory under the maven installation and use that in preference - as maven itself does.
Hide
William Ferguson added a comment -

I still see the issue relating to the embedder not reading the location of the local repository from the M2_HOME/conf/settings.xml (I have a non-default local repository to work around a bug in verison 2.2 of the maven-surefire-plugin).

Is any one planning on fixing it?
I've read the discussion in http://jira.codehaus.org/browse/MNGECLIPSE-116 and there seems to be some confusion over how the local repository should be determined and/or configured for the plugin.

For mine its
1) If M2_HOME env variable exists, read the values from M2_HOME/conf/settings.xml
2) Else look for ${user.home}/.m2 (create if necessary) and read from ${user.home}/.m2/settngs.xml

Alternately respect the value of the 'Local Repsotiory Folder' specified in The Eclipse preferences page for 'Maven2'. Because at the moment this is ignored too. But I think it would be better to read it from the actual Maven config.

Show
William Ferguson added a comment - I still see the issue relating to the embedder not reading the location of the local repository from the M2_HOME/conf/settings.xml (I have a non-default local repository to work around a bug in verison 2.2 of the maven-surefire-plugin). Is any one planning on fixing it? I've read the discussion in http://jira.codehaus.org/browse/MNGECLIPSE-116 and there seems to be some confusion over how the local repository should be determined and/or configured for the plugin. For mine its 1) If M2_HOME env variable exists, read the values from M2_HOME/conf/settings.xml 2) Else look for ${user.home}/.m2 (create if necessary) and read from ${user.home}/.m2/settngs.xml Alternately respect the value of the 'Local Repsotiory Folder' specified in The Eclipse preferences page for 'Maven2'. Because at the moment this is ignored too. But I think it would be better to read it from the actual Maven config.
Hide
William Ferguson added a comment -

Sorry, to be clear - I still the issue in version 0.0.9

Show
William Ferguson added a comment - Sorry, to be clear - I still the issue in version 0.0.9
Hide
Vadim Katz added a comment -

We are randomly experiencing this problem. Eventually restarting eclipse fixes the issue.
We are using eclipse 3.2.1 and 0.0.9 plugin of maven.

Show
Vadim Katz added a comment - We are randomly experiencing this problem. Eventually restarting eclipse fixes the issue. We are using eclipse 3.2.1 and 0.0.9 plugin of maven.
Hide
Eugene Kuleshov added a comment -

According to Maven folks, new Maven Embedder wil garantee that local repository folder is created. I tested it and can't reproduce anymore. So, marking as fixed.

Show
Eugene Kuleshov added a comment - According to Maven folks, new Maven Embedder wil garantee that local repository folder is created. I tested it and can't reproduce anymore. So, marking as fixed.
Hide
Georgi Penchev added a comment -

Hi, I'm still using 0.0.9 version of the plugin, as on the homepage I see an open discussion about this very same problem running still in 0.0.10.

I tried to use Tim Hedger's idea (duplicate my %M2_HOME%\conf\settings.xml to ${user.home}/.m2/settngs.xml, however I run in an unexpected problem - Windows XP won't let me create a folder that begins with the dot symbol. Am I missing something here, or how did you solve this problem?

Show
Georgi Penchev added a comment - Hi, I'm still using 0.0.9 version of the plugin, as on the homepage I see an open discussion about this very same problem running still in 0.0.10. I tried to use Tim Hedger's idea (duplicate my %M2_HOME%\conf\settings.xml to ${user.home}/.m2/settngs.xml, however I run in an unexpected problem - Windows XP won't let me create a folder that begins with the dot symbol. Am I missing something here, or how did you solve this problem?
Hide
Georgi Penchev added a comment -

Ok, never mind, it worked through the command prompt, sorry. Weird Windows won't let you do it from the explorer.

Show
Georgi Penchev added a comment - Ok, never mind, it worked through the command prompt, sorry. Weird Windows won't let you do it from the explorer.

People

Vote (4)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: