jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven Integration for Eclipse
  • MNGECLIPSE-116

Embedder can't find local repository

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 0.0.7
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    WinXP, Eclipse 3.1.2, Maven2.0.4

Description

I upgraded from 0.0.5 to 0.0.7 and the plugin fails to load.

Below is output from the workspace log file:

java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.
at org.apache.maven.embedder.MavenEmbedder.createMavenSettings(MavenEmbedder.java:699)
at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:628)
at org.maven.ide.eclipse.Maven2Plugin.createEmbedder(Maven2Plugin.java:267)
at org.maven.ide.eclipse.Maven2Plugin.getMavenEmbedder(Maven2Plugin.java:155)
at org.maven.ide.eclipse.Maven2Plugin.executeInEmbedder(Maven2Plugin.java:165)
at org.maven.ide.eclipse.Maven2Plugin.start(Maven2Plugin.java:112)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:994)
at java.security.AccessController.doPrivileged(Native Method)
....

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    20060526_MNGECLIPSE-116_trunk.patch
    26/May/06 10:39 AM
    7 kB
    Ovidio Mallo
  2. Text File
    20060529_MNGECLIPSE-116_trunk.patch
    29/May/06 4:03 PM
    7 kB
    Ovidio Mallo
  3. Hide
    Java Archive File
    maven-embedder-2.0.4_fixed-dep.jar
    26/May/06 10:39 AM
    1.24 MB
    Ovidio Mallo
    1. File
      META-INF/MANIFEST.MF 0.1 kB
    2. File
      org/.../MavenEmbedderLoggerManager.class 3 kB
    3. File
      org/.../AbstractMavenEmbedderLogger.class 2 kB
    4. File
      org/apache/.../MavenEmbedderLogger.class 0.7 kB
    5. File
      org/apache/.../PlexusLoggerAdapter.class 3 kB
    6. File
      org/.../MavenEmbedderConsoleLogger.class 2 kB
    7. File
      org/apache/.../SummaryPluginDescriptor.class 0.8 kB
    8. File
      org/apache/.../embedder/MavenEmbedder.class 20 kB
    9. File
      org/apache/.../MavenEmbedderException.class 0.7 kB
    10. File
      META-INF/maven/.../pom.properties 0.1 kB
    11. XML File
      META-INF/maven/.../maven-embedder/pom.xml 11 kB
    12. XML File
      plugins/maven-jar-plugin.xml 3 kB
    13. XML File
      plugins/maven-compiler-plugin.xml 16 kB
    14. File
      org/apache/.../xpp3/MetadataXpp3Reader.class 19 kB
    15. File
      org/apache/.../xpp3/MetadataXpp3Writer.class 5 kB
    16. File
      org/apache/.../metadata/Versioning.class 3 kB
    17. File
      org/apache/maven/.../metadata/Metadata.class 5 kB
    18. File
      org/apache/maven/.../metadata/Plugin.class 1 kB
    19. File
      org/apache/maven/.../metadata/Snapshot.class 1 kB
    20. File
      META-INF/maven/.../pom.properties 0.1 kB
    21. XML File
      META-INF/maven/.../pom.xml 17 kB
    22. File
      org/apache/.../xpp3/ParamdocXpp3Reader.class 17 kB
    23. File
      org/apache/.../xpp3/ParamdocXpp3Writer.class 4 kB
    24. File
      org/apache/.../ExpressionDocumentation.class 2 kB
    25. File
      org/apache/maven/.../plugin/Expression.class 3 kB
    26. File
      META-INF/maven/.../pom.properties 0.1 kB
    27. XML File
      META-INF/maven/.../pom.xml 18 kB
    28. File
      com/jcraft/jsch/jce/AES256CBC.class 1 kB
    29. File
      com/jcraft/jsch/jce/AES128CBC.class 1 kB
    30. File
      com/jcraft/jsch/jce/DH.class 2 kB
    Showing 30 of 869 items Download Zip
    Show
    Java Archive File
    maven-embedder-2.0.4_fixed-dep.jar
    26/May/06 10:39 AM
    1.24 MB
    Ovidio Mallo

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-124 Plugin fail to initialize when default maven repository folder is not available

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is duplicated by

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-201 IllegalArgumentException on Fedora Eclipse 3.1.2

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Bug - A problem which impairs or prevents the functions of the product. MNGECLIPSE-195 Error Loading Eclipse Preference page after installing Maven plugin

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Eugene Kuleshov added a comment - 02/May/06 12:17 AM

Not sure what it is, but you should know better what mya cause this error (from your own stack):

java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.

This happesn when Maven itself can't initialize local repository. So, what the hack do you have?

Show
Eugene Kuleshov added a comment - 02/May/06 12:17 AM Not sure what it is, but you should know better what mya cause this error (from your own stack): java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method. This happesn when Maven itself can't initialize local repository. So, what the hack do you have?
Hide
Permalink
Cliff Resnick added a comment - 02/May/06 9:50 AM

After a little debugging I faound that Maven Embedder assumes local repository is under <user.home>/.m2.
Mine is not since, the network policy here limits (network replicated) user home space.

Even though Embedder has a 'setLocalRepositoryDirectory', it' seems to be disregarded, as is setAlignWithUserInstallation; everything hinges on :

if((new File(userHome, ".m2")).exists())
alignWithUserInstallation = true;

No alignWithUserInstallation means localRepository = null;

A way around this would be to launch eclipse overriding System property 'user.home' and make sure there is an .m2 dir to whereever it's set. This would solve the null local repository, but then the whole thing starts to smell. I mean, isn't the idea with aligning with user installation to get settings from $M2_HOME/conf/settings.xml? Shouldn't there be a setM2Home method on embedder, or how will it find settings.xml? Meanwhile it won't even let you set repository location.

Hopefully I'm missing something since I only had time to look at it briefly, but embedder seems to still be a work in progress...

Show
Cliff Resnick added a comment - 02/May/06 9:50 AM After a little debugging I faound that Maven Embedder assumes local repository is under <user.home>/.m2. Mine is not since, the network policy here limits (network replicated) user home space. Even though Embedder has a 'setLocalRepositoryDirectory', it' seems to be disregarded, as is setAlignWithUserInstallation; everything hinges on : if((new File(userHome, ".m2")).exists()) alignWithUserInstallation = true; No alignWithUserInstallation means localRepository = null; A way around this would be to launch eclipse overriding System property 'user.home' and make sure there is an .m2 dir to whereever it's set. This would solve the null local repository, but then the whole thing starts to smell. I mean, isn't the idea with aligning with user installation to get settings from $M2_HOME/conf/settings.xml? Shouldn't there be a setM2Home method on embedder, or how will it find settings.xml? Meanwhile it won't even let you set repository location. Hopefully I'm missing something since I only had time to look at it briefly, but embedder seems to still be a work in progress...
Hide
Permalink
Eugene Kuleshov added a comment - 06/May/06 1:55 PM

Jason. can you please comment on this? I think there are two issues here: non-standard location of .m2 directory and also embedder is failing if local repository folder does not exists.

Show
Eugene Kuleshov added a comment - 06/May/06 1:55 PM Jason. can you please comment on this? I think there are two issues here: non-standard location of .m2 directory and also embedder is failing if local repository folder does not exists.
Hide
Permalink
Ovidio Mallo added a comment - 26/May/06 10:39 AM

There seem to be two issues in the embedder when trying to work with a
non-standard repository, depending on whether another repository in the standard
location (~/.m2) exists or not:

1) If you want to use a repository which does not reside at the standard
location and NO other repository at the standard location exists, the embedder
requires you to invoke the MavenEmbedder.setLocalRepositoryDirectory( File )
method which internally sets the localRepositoryDirectory variable. However,
when starting the embedder, it erroneously checks whether the variable
localRepository and not localRepositoryDirectory has been set! This wrong
check is performed at line 697, i.e. exactly where Cliff is getting the
exception. Hence, I'm pretty sure, that this is a mere mistyping bug.

2) If you want to use a repository at some non-standard location AND you
also have a repository at the standard location, the embedder always aligns
with the standard location repository. This is a different issue which
is most probably not related to Cliff's problem.

The embedder attached to this bug should fix the simple problem 1) described
above. However, also the plugin needs to be adapted, since currently the
plugin activation fails when no repository can be found i.e. you never get
to the Maven2 preference page where you could actually set the repository
location, which is bad So, the provided patch does the following:

  • Avoid that the plugin crashes upon activation and inform the user (in a
    user dialog) when no repository can be found.
  • Update the local repository index whenever the repository is changed in the
    preferences.
  • Fixes the related bug MNGECLIPSE-112.

So, if you like, Cliff, you may check whether this solves your problem...

Show
Ovidio Mallo added a comment - 26/May/06 10:39 AM There seem to be two issues in the embedder when trying to work with a non-standard repository, depending on whether another repository in the standard location (~/.m2) exists or not: 1) If you want to use a repository which does not reside at the standard location and NO other repository at the standard location exists, the embedder requires you to invoke the MavenEmbedder.setLocalRepositoryDirectory( File ) method which internally sets the localRepositoryDirectory variable. However, when starting the embedder, it erroneously checks whether the variable localRepository and not localRepositoryDirectory has been set! This wrong check is performed at line 697, i.e. exactly where Cliff is getting the exception. Hence, I'm pretty sure, that this is a mere mistyping bug. 2) If you want to use a repository at some non-standard location AND you also have a repository at the standard location, the embedder always aligns with the standard location repository. This is a different issue which is most probably not related to Cliff's problem. The embedder attached to this bug should fix the simple problem 1) described above. However, also the plugin needs to be adapted, since currently the plugin activation fails when no repository can be found i.e. you never get to the Maven2 preference page where you could actually set the repository location, which is bad So, the provided patch does the following:
  • Avoid that the plugin crashes upon activation and inform the user (in a user dialog) when no repository can be found.
  • Update the local repository index whenever the repository is changed in the preferences.
  • Fixes the related bug MNGECLIPSE-112.
So, if you like, Cliff, you may check whether this solves your problem...
Hide
Permalink
Ovidio Mallo added a comment - 29/May/06 4:03 PM

I have just replaced the patch by a new one since the original one had a minor conflict with the code
changes for today's release 0.0.8.

Show
Ovidio Mallo added a comment - 29/May/06 4:03 PM I have just replaced the patch by a new one since the original one had a minor conflict with the code changes for today's release 0.0.8.
Hide
Permalink
Wolfgang S added a comment - 05/Jun/06 11:20 AM

I have tried v 0.0.8 and v 0.0.9 replacing maven-embedder-2.0.4-dep.jar with the patched version provided here using eclipse 3.2RC7. I still can not even open the preferences dialog

java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method.
at org.apache.maven.embedder.MavenEmbedder.createMavenSettings(MavenEmbedder.java:699)
at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:628)
at org.maven.ide.eclipse.Maven2Plugin.createEmbedder(Maven2Plugin.java:269)
at org.maven.ide.eclipse.Maven2Plugin.getMavenEmbedder(Maven2Plugin.java:157)
at org.maven.ide.eclipse.Maven2Plugin.executeInEmbedder(Maven2Plugin.java:167)
at org.maven.ide.eclipse.Maven2Plugin.start(Maven2Plugin.java:112)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:995)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:989)

Show
Wolfgang S added a comment - 05/Jun/06 11:20 AM I have tried v 0.0.8 and v 0.0.9 replacing maven-embedder-2.0.4-dep.jar with the patched version provided here using eclipse 3.2RC7. I still can not even open the preferences dialog java.lang.IllegalArgumentException: When not aligning with a user install you must specify a local repository location using the setLocalRepositoryDirectory( File ) method. at org.apache.maven.embedder.MavenEmbedder.createMavenSettings(MavenEmbedder.java:699) at org.apache.maven.embedder.MavenEmbedder.start(MavenEmbedder.java:628) at org.maven.ide.eclipse.Maven2Plugin.createEmbedder(Maven2Plugin.java:269) at org.maven.ide.eclipse.Maven2Plugin.getMavenEmbedder(Maven2Plugin.java:157) at org.maven.ide.eclipse.Maven2Plugin.executeInEmbedder(Maven2Plugin.java:167) at org.maven.ide.eclipse.Maven2Plugin.start(Maven2Plugin.java:112) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:995) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:989)
Hide
Permalink
Ovidio Mallo added a comment - 05/Jun/06 11:51 AM

Hi Wolfgang, have you also applied the provided patch? This is necessary since the fixed embedder still (legitimately) throws the above exception when it cannot find a default repository nor is any other repository set in the preferences. The patch for the plugin provides a mechanism to catch the exception thrown by the embedder and then inform the user about the missing maven repository. So, replacing only the embedder does not help much for solving your bootstrapping problem...
Hope applying the patch does the trick for you!

Show
Ovidio Mallo added a comment - 05/Jun/06 11:51 AM Hi Wolfgang, have you also applied the provided patch? This is necessary since the fixed embedder still (legitimately) throws the above exception when it cannot find a default repository nor is any other repository set in the preferences. The patch for the plugin provides a mechanism to catch the exception thrown by the embedder and then inform the user about the missing maven repository. So, replacing only the embedder does not help much for solving your bootstrapping problem... Hope applying the patch does the trick for you!
Hide
Permalink
Stian Soiland added a comment - 13/Jun/06 6:34 AM

Still fails with 0.0.9 of the plugin (which is btw not listed on http://m2eclipse.codehaus.org/ which claims 0.0.5 is the latest) using Eclipse 3.2RC7 on OS X (intel).

Not even the preference dialogue for setting the repository works. However, just doing a "mkdir .m2" in $HOME solved the problem.

I still think the plugin should be able to fix this creation itself. I'm writing a howto for using Maven/Eclipse on our project, and will have to mention this bug for new maven users.

Show
Stian Soiland added a comment - 13/Jun/06 6:34 AM Still fails with 0.0.9 of the plugin (which is btw not listed on http://m2eclipse.codehaus.org/ which claims 0.0.5 is the latest) using Eclipse 3.2RC7 on OS X (intel). Not even the preference dialogue for setting the repository works. However, just doing a "mkdir .m2" in $HOME solved the problem. I still think the plugin should be able to fix this creation itself. I'm writing a howto for using Maven/Eclipse on our project, and will have to mention this bug for new maven users.
Hide
Permalink
Ovidio Mallo added a comment - 13/Jun/06 6:47 AM

Hi Stian, the here provided patch has never been integrated into the code. However, the current development version of the plugin now uses the new MavenEmbedder version 2.1 which seems not to suffer from the here described problem. Therefore, I guess that the next release of the plugin will fix this issue.

Show
Ovidio Mallo added a comment - 13/Jun/06 6:47 AM Hi Stian, the here provided patch has never been integrated into the code. However, the current development version of the plugin now uses the new MavenEmbedder version 2.1 which seems not to suffer from the here described problem. Therefore, I guess that the next release of the plugin will fix this issue.
Hide
Permalink
Wolfgang S added a comment - 28/Jul/06 12:50 AM

Thank you Ovidio Mallo.
> Hope applying the patch does the trick for you!
I have had applied the patch.
This was not the problem. But I was an maven newbie.
So checking and repairing my maven-2 installation did the trick for me.
I do not remember the problem in detail - maybe a missing environment variable.

  • sorry for inconvenience -
Show
Wolfgang S added a comment - 28/Jul/06 12:50 AM Thank you Ovidio Mallo. > Hope applying the patch does the trick for you! I have had applied the patch. This was not the problem. But I was an maven newbie. So checking and repairing my maven-2 installation did the trick for me. I do not remember the problem in detail - maybe a missing environment variable.
  • sorry for inconvenience -
Hide
Permalink
Ricardo Gladwell added a comment - 09/Oct/06 9:49 AM

This problem was fixed for me by manually installing M2 on my local machine and executing ./mvn -version. I wasn't aware that the Eclipse plugin also required maven installed on the local machine. It would be nice if the M2 Eclipse plugin would optionally offer to install maven 2 on the update site.xml, and/or set-up the $HOME/.m2 directory automatically. Is it worth raising seperate feature bugs for these points?

Show
Ricardo Gladwell added a comment - 09/Oct/06 9:49 AM This problem was fixed for me by manually installing M2 on my local machine and executing ./mvn -version. I wasn't aware that the Eclipse plugin also required maven installed on the local machine. It would be nice if the M2 Eclipse plugin would optionally offer to install maven 2 on the update site.xml, and/or set-up the $HOME/.m2 directory automatically. Is it worth raising seperate feature bugs for these points?
Hide
Permalink
Eugene Kuleshov added a comment - 09/Oct/06 10:11 AM

Ricardo, all you need to do is to run maven once (even from launch configuration should be enough) or to create that folder manually. As been said this is just a current work around and will be fixed in scope of this issue.

Show
Eugene Kuleshov added a comment - 09/Oct/06 10:11 AM Ricardo, all you need to do is to run maven once (even from launch configuration should be enough) or to create that folder manually. As been said this is just a current work around and will be fixed in scope of this issue.
Hide
Permalink
Ricardo Gladwell added a comment - 09/Oct/06 10:24 AM

Thanks for the feedback Eugene. I'm still not clear if MNGECLIPSE requires M2 installed first which could be a separate issue.

Show
Ricardo Gladwell added a comment - 09/Oct/06 10:24 AM Thanks for the feedback Eugene. I'm still not clear if MNGECLIPSE requires M2 installed first which could be a separate issue.
Hide
Permalink
Eugene Kuleshov added a comment - 09/Oct/06 12:17 PM

No, there is no need to install Maven. Embedder component used by plugin is basically the same thing as command line Maven is using.

Show
Eugene Kuleshov added a comment - 09/Oct/06 12:17 PM No, there is no need to install Maven. Embedder component used by plugin is basically the same thing as command line Maven is using.
Hide
Permalink
Mikel Arroyo added a comment - 10/Oct/06 4:20 AM

I've just installed version 0.0.9 and as I understand there is no fix for this bug.
Also, I would like to say to Ricardo that his problem has been solved because when you installed Maven it created de .m2 directory under C:/Documents and Settings/youruser

Show
Mikel Arroyo added a comment - 10/Oct/06 4:20 AM I've just installed version 0.0.9 and as I understand there is no fix for this bug. Also, I would like to say to Ricardo that his problem has been solved because when you installed Maven it created de .m2 directory under C:/Documents and Settings/youruser
Hide
Permalink
Joachim Hubele added a comment - 24/Oct/06 2:48 AM

I could not get this to work at all. Neither with eclipse 3.1, 3.2, or plugin 0.0.9, 0.1.0. I had the .m2 setup properly. For some poeple in my team it works, for some it does not.
Can someone HELP here, PLEASE.

Show
Joachim Hubele added a comment - 24/Oct/06 2:48 AM I could not get this to work at all. Neither with eclipse 3.1, 3.2, or plugin 0.0.9, 0.1.0. I had the .m2 setup properly. For some poeple in my team it works, for some it does not. Can someone HELP here, PLEASE.

People

  • Assignee:
    Unassigned
    Reporter:
    Cliff Resnick
Vote (3)
Watch (6)

Dates

  • Created:
    01/May/06 2:03 PM
    Updated:
    24/Oct/06 2:48 AM
    Resolved:
    10/Oct/06 12:55 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.