Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
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)
....
-
- 20060526_MNGECLIPSE-116_trunk.patch
- 26/May/06 10:39 AM
- 7 kB
- Ovidio Mallo
-
- 20060529_MNGECLIPSE-116_trunk.patch
- 29/May/06 4:03 PM
- 7 kB
- Ovidio Mallo
-
Hide
- maven-embedder-2.0.4_fixed-dep.jar
- 26/May/06 10:39 AM
- 1.24 MB
- Ovidio Mallo
-
- META-INF/MANIFEST.MF 0.1 kB
- org/.../MavenEmbedderLoggerManager.class 3 kB
- org/.../AbstractMavenEmbedderLogger.class 2 kB
- org/apache/.../MavenEmbedderLogger.class 0.7 kB
- org/apache/.../PlexusLoggerAdapter.class 3 kB
- org/.../MavenEmbedderConsoleLogger.class 2 kB
- org/apache/.../SummaryPluginDescriptor.class 0.8 kB
- org/apache/.../embedder/MavenEmbedder.class 20 kB
- org/apache/.../MavenEmbedderException.class 0.7 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../maven-embedder/pom.xml 11 kB
- plugins/maven-jar-plugin.xml 3 kB
- plugins/maven-compiler-plugin.xml 16 kB
- org/apache/.../xpp3/MetadataXpp3Reader.class 19 kB
- org/apache/.../xpp3/MetadataXpp3Writer.class 5 kB
- org/apache/.../metadata/Versioning.class 3 kB
- org/apache/maven/.../metadata/Metadata.class 5 kB
- org/apache/maven/.../metadata/Plugin.class 1 kB
- org/apache/maven/.../metadata/Snapshot.class 1 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../pom.xml 17 kB
- org/apache/.../xpp3/ParamdocXpp3Reader.class 17 kB
- org/apache/.../xpp3/ParamdocXpp3Writer.class 4 kB
- org/apache/.../ExpressionDocumentation.class 2 kB
- org/apache/maven/.../plugin/Expression.class 3 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../pom.xml 18 kB
- com/jcraft/jsch/jce/AES256CBC.class 1 kB
- com/jcraft/jsch/jce/AES128CBC.class 1 kB
- com/jcraft/jsch/jce/DH.class 2 kB
Issue Links
- duplicates
-
MNGECLIPSE-124
Plugin fail to initialize when default maven repository folder is not available
-
- is duplicated by
-
MNGECLIPSE-201
IllegalArgumentException on Fedora Eclipse 3.1.2
-
-
MNGECLIPSE-195
Error Loading Eclipse Preference page after installing Maven plugin
-
Activity
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...
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.
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...
- 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.
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.
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)
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!
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.
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.
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 -
- sorry for inconvenience -
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?
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.
Thanks for the feedback Eugene. I'm still not clear if MNGECLIPSE requires M2 installed first which could be a separate issue.
No, there is no need to install Maven. Embedder component used by plugin is basically the same thing as command line Maven is using.
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
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.
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?