m2e is no longer working in my Eclipse Indigo. Nothing is printed to the Maven console, I can't download any sources and some dependencies won't be resolved.
I'm using the embedded Maven installation.
Do you know how to fix this issue?
Just a wild guess (due to similar problems I had in the past):
If you use the embedded m2e Maven installation, Maven has no information to your settings.
If you are in a corporate environment, you have to set your proxy in a Maven related location:
In your users settings.xml file.
In your Maven installation settings.xml file
m2e can only use the proxy set in your Maven settings file, not the one in your eclipse environment. So as a result, you could see all the old libraries contained in local repositories, but no new ones contained only in remote repositories located somewhere on the internet.
Please add some more information about your configuration in eclipse (does eclipse find your user settings.xml file?) and the errors you get.
Try -clean workspace option. Or if it doesn't help, create new workspace, test if m2e started working and import your old projects. I just resolved issue very similar to yours using second option.
Here is good explanation of such kind of troubles: http://www.eclipsezone.com/eclipse/forums/t61566.html
Related
I'm planning to create a java maven web project. I would like to know whether I have to install Maven in windows or install maven in eclipse? I'm using windows 10 and eclipse oxygen. My network has some restrictions so I would be adding a proxy in settings.xml.
I have already tried creating a maven project in eclipse with maven embedded in my eclipse, but it was giving multiple errors during jars download.
Please suggest me on which way I should proceed and which way is better, whether I should use maven in eclipse or install in windows and use?
Usually, you use the embedded Maven in Eclipse, which is part of a standard modern Eclipse installation.
If you get errors with jar downloads, this is probably an issue with your network. Whether putting a proxy in the settings.xml is enough to remedy the problem depends on you actual network.
To find out the exact network restrictions, talk to your admin.
I think you should just try use a different network to create your maven project (for example you can use tethering or ask for permission to get around those network restrictions). After that you should be able to use your maven project even offline.
An alternative would be to just download a maven project and change it to your own.
You can try installing maven:
Go to maven's website to install/configure maven for your os
Set Maven's settings.xml
Configure Maven in your eclipse, choose the installed maven rather than embedded
If your have any errors, please post them here.
In my previous pc I was working with linux, eclipse Indigo, m2e (I suppose v1.2 or v1.3) and maven 2.
I had configured m2e to use my external maven 2 installation, had projectA depend on projectB and without the need to install any of the projects to the maven local repository I could execute an Eclipse Maven Build (e.g: compile or dependency:tree) configured to use the external maven installation and to Resolve artifacts in workspace. That worked.
Now, I 'm using win7, eclipse kepler, m2e 1.4.1 and maven 3. I configured all in the same fashion (use external maven installation), create the same projects, use the same eclipse Maven build (run configuration) with workspace artifact resolution enabled and it don't work.
Right now it only works if i configure the maven build to use the internal eclipse embedded maven installation.
I 'd really like to always use my external instalation, does anyone knows if this feature was removed from m2e or should this scenario work as I expected and maybe it's a bug thats happening in my specific environment?
It's worth checking that the settings.xml for your external maven makes sense, and eclipse is configured to use it.
I 've tested in other similar environments obtaining same results but, when
upgraded to Eclipse Luna problem was solved.
If you 're facing similar problem, then upgrade to Eclipse Luna.
I've been dealing with this problems for days now.
I need to install maven and the eclipse plug-in "maven2eclipse" on an offline environment.
So far I've installed maven on the computer but I'm not able to import or open a maven project in eclipse when I right click and select "import source" in the package/project explorer. Maven alternatives simply aren't there for me to use even though I've installed all of the plug-ins that m2e repository has to offer.
I've downloaded the m2e-repository for a local version with these commandlines:
Artifact and metadata (replacing .artifact. with .metadata. and running it again)
"C:\eclipse Java EE\eclipse.exe" -application org.eclipse.equinox.p2.artifact.repository.mirrorApplication \ -source http://download.eclipse.org/technology/m2e/releases \ -destination C:\Maven2Eclipse\repos
I then moved this local folder to the offline system and used it as a local repository.
I've also downloaded the helios repository, but I haven't installed anything from it. Becuase I seemed to be lacking some important dependancies without it. Something with eclipse.UI.. haven't been able to reproduce it.
Anyways, I've added the downloaded repositories to the disposal of my offline environment.
I installed everything with "m2e" and/or "maven" in it's name but I still can't import an "existing maven project". The option simply isn't there.
Here's a screenshot of what m2e software I have installed using the "install new software".
http://i.imgur.com/xPKN6qn.png
Have I missed something? There's something missing and keeping me from actually being able to select the import source "import an existing maven project".
I've been searching the web like crazy and I cannot find anything that resembles my problem.
There's quite a lot on mirroring eclipse repositories and what not but I don't seem to have a problem whit that, unless something didn't get downloaded.
Thanks in advance for any help.
It is better if you can update eclipse with the automatic update by using the url online directly.downloading and then installing the plugin manually causes a lot of issues as some plugins might not get downloaded properly in the installer or some plugins may be completely missing from the installer itself.
Please check the proper url to install the plugin automatically which matches with the version of the eclipse you may be using.
Just...check this two things, if you go in eclipse configuration, inside the Maven tab?
1: Check the Offline mode...
2: Try to use the Maven you've installed (not the embedded one..)
I solved the issue by manually copying all plugins and feature files into their respective folders, making sure everything was installed as well and then restarting eclipse a couple of times with the -clean addition. After that, it started working.. weird :/
Thanks for the answers though!
I'd like to set the ftp servers for deploying from STS as described here: http://maven.apache.org/plugins/maven-deploy-plugin/examples/deploy-ftp.html
It should be in the settings.xml.
According to documentation settings is in either of 2:
The Maven install: $M2_HOME/conf/settings.xml
A user's install: ${user.home}/.m2/settings.xml
Where is the $M2_HOME. In other terms when working from STS(Eclipse), what is the installation folder for maven in this case. I can't find a settings.xml in ${user.home}/.m2/ .
I worked under Windows 7
Those 2 threads are related but do not provide a clear answer that worked for me at least:
maven doesnt seem to be installing with springsource tool suite
Eclipse (STS) + Maven , I have nothing appearing in the screenshot suggested in this last thread.
Thx in advance
I may be off-mark as I've never used STS myself, but if I understand correctly it is just a pre-packaged Eclipse distribution. If I'm correct your installation only contains an embedded version of Maven, but not a command line accessible one. You need to install one from here.
With the 3.x releases of Eclipse I found that you need to have your installation point to an external Maven installation for Eclipse to make use of the settings.xml files. Once you installed a downloaded version you can choose Window -> Preferences -> Maven -> Installations, press Add... and point to the version you just installed.
In Spring Tools Suite (3.6.1):
Windows - Preferences - Maven - User Settings, you can select which global- and user- version of the settings.xml to use.
Global maven settings.xml exist at apache-maven-3.0.4\conf\settings.xml [inside the maven installation]
and
Local maven settings.xml exist at C\Users\[username]\.m2\settings.xml[window OS install on C drive]
I have a project (built from an AppFuse template) that requires Maven 2.2.1. So I upgraded to this (from 2.1.0) and set my path and my M2_HOME and MAVEN_HOME env variables.
Then I ran mvn eclipse:eclipseand imported the project into Eclipse (Galileo).
However, in the problems list for the project (and at the top of the pom.xml GUI editor) it says:
Unable to build project
'/export/people/clegg/data/Workspace/funcserve/pom.xml;
it requires Maven version 2.2.1
This persists whether I set Eclipse to use its Embedded Maven implementation, or the external 2.2.1 installation, in the Preferences -> Maven -> Installations dialog.
I've tried closing and reopening the project, reindexing the repository, cleaning the project, restarting the IDE, logging out and back in again, everything I can think of! But Eclipse still won't believe I have Maven 2.2.1.
I just did a plugin update so I have the latest version of Maven Integration for Eclipse -- 0.9.8.200905041414.
Does anyone know how to convince Eclipse I really do have the right version of Maven? It's like it's recorded the previous version somewhere else and won't pay any attention to my changes :-(
Eclipse allows you to specify an external Maven installation. But there's a catch. :(
Have a look at Windows > Preferences > Maven > Installations.
You will see a message like this:
Note: Embedded runtime is always used for dependency resolution, but does
not use global settings when it is used to launch Maven.
To learn more, visit the maven web page.
Translating to English, it means that Eclipse will continue to employ its internal Maven instance in order to perform some tasks.
When you "Run As > maven install" it will run your pom.xml script employing the external Maven instance you specified but when Eclipse performs some of its internal stuff, it will continue to use the embedded Maven instance, whatever version it is.
(edited)
As far as I know, when you install M2Eclipse you are implicitly defining which "internal Maven instance" you will have, which is exactly that one packaged by the plugin.
In the plugin configuration, you can add external Maven instances by telling where they are installed.
If you are using a recent m2eclipse version, you can try this too:
<prerequisites>
<maven>>=2.2.1</maven>
</prerequisites>
Notice the greater than in >=2.2.1. It works fine for me.
A common source of trouble (of this kind) is if you change global preferences and don't remember or know that you have enabled some project specific settings. At least it's a chance that the global setting is now set to use the external maven but the project setting is still set to 'embedded'.
M2Eclipse uses an embedded maven instance, not the maven instance you have installed on your system.
Have you tried switching workspaces?
You can still reference the same project in the new workspace. This would provide about as much of a reset as you can do in terms of eclipses internal settings.
Try creating your eclipse project with mvn project:m2eclipse or use the maven import option under import project.
Using m2eclipse, my fallback in these situations is to do Maven > Update Dependencies and then Maven > Update Project Configuration. The first is just me being supersticious, but the second will rewrite .project and .classpath.
As Pascal says about, m2eclipse can also be pointed at an external instance. I've done this in the past, though not at 2.2.1.
Dan
I got the same issue. Resolved it by restarting the system because every time you change the 'Path' in environment variables you should restart the system or else if would not pick the changes.