Aquire container failed! in Eclipse IDE at Update Maven - eclipse

I'm updating maven dependencies in my project with Maven Update command of Eclipse IDE 2022-12 version (last version) and the ide if saying to my the next error:
Do anyone know how to solve this error?
I'm deleted .metadata folder, purge local repository .m2 for maven and nothing was well.
Thanks!! And Happy New Year 2023!!

For me, closing all projects in different working sets except the one I want to build solved the issue for the moment (of course only a temporary solution).

Related

Maven projects import does not work well

This is a weird problem and probably, It has a stupid solution, but still.
I have recently install a windows 32 bit machine on a VBOX (runs originally on linux). I don't know if it is important but maybe.
I installed a fresh eclipse Juno with m2e and m2e-wtp.
I checked out a maven project (multi module) from SVN and then i tried to Import it as maven project to eclipse, simply by right clicking --> import --> maven --> existing maven project.
I have done this millions time with no problems till now.
Eclipse imports all the projects but they all have this error:
Project build error: Non-resolvable parent POM: Could not find artifact com.xx.xx:parent-pom:pom:1.0.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM.
Also, when I right click a java project, and check it's properties it seems that eclipse does not recognize it as a java project (I added a screenshot).
I wish to state that I am the only one here to have this problem, so I assume this is an eclipse problem.
Please help.
Regards,
Idob
Are you sure, that the parent-pom is available in the correct version?
The error message tells you that the parent-pom is not available.
Either it has to be available as an eclipse project, or it has to be available at your repository. You can find your local repository in WinXP machine by default at Documents and Settings\.m2\repository.

How to fix error "Updating Maven Project". Unsupported IClasspathEntry kind=4?

I have imported maven project in STS, when I run update update project I receive:
"Updating Maven Project". Unsupported IClasspathEntry kind=4
Is there a workaround for this?
This issue has been fixed in m2e 1.5.0 which is available for Eclipse Kepler (4.3) and Luna (4.4)
Please see https://bugs.eclipse.org/bugs/show_bug.cgi?id=374332#c14
The problem is caused by the fact that STS (the Spring IDE/Eclipse), as well Eclipse and other Eclipse based IDE's, use the m2e(clipse) plugin but that eclipse:eclipse has been probably been run on the project. When m2e encounters a "var" .classpath entry, it throws this error.
The update sites are specified at the following url:
http://eclipse.org/m2e/m2e-downloads.html
If you can't use m2e 1.5.0 for any reason, then :
Disable the maven nature for the project (via the right-click menu)
Run mvn eclipse:clean (while your project is open in STS/eclipse). Depending on the timing, you might need to do a refresh or two on the project before re-enabling the maven nature. You should be able to see that your project has lost it's Maven nature. (The eclipse:clean goal just deletes the .project, .classpath and .settings/ files/directories. You can also just remove those files (again while the project is open) instead of running mvn eclipse:clean.)
Re-enable the maven nature.
(Most of the time, this can be done by right-clicking on the project in question in the package explorer pane, and then choosing 'Configure'-> 'Convert to Maven Project')
Right-click on your project, select Maven -> Remove Maven Nature.
Open you terminal, go to your project folder and do mvn eclipse:clean
Right click on your Project and select “Configure -> Convert into Maven Project”
Now you got “Unsupported IClasspathEntry kind=4 Eclipse Scala” disappear.
Sometimes, even re-importing the Maven project will not work. Updating the project correctly in eclipse is not a deterministic process.
The only 100% fail safe procedure I've found is:
Disable Maven Nature, run mvn eclipse:clean, restart, cross your fingers and Pray 3 times.
If this won't work, delete the project, run mvn eclipse:clean, re-import refresh, pray and use the force.
If this still doesn't work, restart Eclipse, or even better your computer. While waiting for the reboot, you can make a random donation to fix your Karma. Repeat step 2 and don't forget to pray and control your anger. Anger leads to hate. Hate leads to suffering.
Try all the other answers posted in this thread. You might need to try them all for 3 times at least before giving up.
Format your Computer, re-install Eclipse and Maven. No need to pray anymore, all gods hate you anyway
Delete your git project, burn the physical drive that stored the remote repository, and write your project from scratch.
Find a time machine, travel to the past and convince yourself to follow another, non-programming career or at least to avoid Java
Make sure that the version of the m2e(clipse) plugin that you're running is at least 1.1.0
Close maven project - right click "Close Project"
Manualy remove all classpathentry with kind="var" in .classpath file
Open project
or
Remove maven project
Manualy rmeove .classpath
4 Reimport project
Have you tried:
If you have import project into the eclipse 4, please delete it.
In maven consol, run: mvn eclipse:clean
In Eclipse 4: File -> Import -> Maven -> Existing Maven Projects
Seeing all other answers. I found for me a simpler way.
I just removed all lines in the .classpath (editing with eclipse) containing a var and used maven -> update project without an error.
This error is also thrown if the update command is used on a project instrumented for code coverage with Clover.
To resolve in this scenario:
Un-instrument the project folders you wish to update.
Run the maven update then instrument for code coverage again.
I tried Marco's steps but no luck. Instead if you just get the latest m2e plugin from the link he provides and one by one right click on each project -> Maven -> Update Dependencies the error still pops up but the issue is resolved. That is to say the warnings disappear in the Markers view. I encountered this issue after importing some projects into SpringSource Tool Suite (STS). When I returned to my Eclipse Juno installation the warnings were displaying. Seeing that I had m2e 1.1 already installed I tried Marco's steps to no avail. Getting the latest version fixed it however.
I couldn't get mvn eclipse:clean etc to work with Kepler.
However I changed creating and extending variables to just using external jars in my eclipse classpath. This was reflected in no var's in my .classpath.
This corrected the problem. I was able to do a Maven update.
This issue (https://bugs.eclipse.org/394042) is fixed in m2e 1.5.0 which is available for Eclipse Kepler and Luna from this p2 repo :
http://download.eclipse.org/technology/m2e/releases/1.5
If you also use m2e-wtp, you'll need to install m2e-wtp 1.1.0 as well :
http://download.eclipse.org/m2e-wtp/releases/luna/1.1
Upgrading from Kepler to Luna worked for me.
I had just added some components for Java 1.8 support. It seems that they where not as compatible as I would like or that I mixed the wrong ones. It really caused a lot of problems. Trying to update the system reported errors as they couldn't fulfill some dependencies. Maven upgrades didn't work. Tried a lot of things.
So, if there is no reason to avoid the upgrade just add the luna repository to avalilable software sites (Luna http://download.eclipse.org/releases/luna/ ) and "check for updates". It is better to have all the components with the same version and there are some nice new features.
I tried all the steps mentioned here and on similar questions but couldn't solve this problem. I could neither solve problem nor update my m2eclipse. So I installed Eclipse Luna and it solved my problem... though it mean that I had to spend about 45 min to configure all the environment in my workspace.
Try
mvn clean install eclipse:eclipse -Dwtpversion=2.0 command on DOS command prompt.
Suggesting you because , It worked for me!!
I'm using Eclipse 4.3.2 (Kepler) with M2E 1.4.x and felt over this problem several times!
In my case the "mvn eclipse:eclipse" command also generates Checkstyle, PMD and Findbugs configuration so "mvn eclipse:clean" does not help me because it drops all those config files again.
The best solution for me was to delete all ".classpath" files:
find . -name ".classpath" -delete
and import the project into eclipse afterwards.
Before importing the project, it should be converted into eclipse project
mvn eclipse: eclipse
Then i found the following error.
An internal error occurred during: "Importing Maven projects".Unsupported IClasspathEntry kind=4
Where is the value kind = "var" that M2E does not recognize and therefore throws the error.
Now type this.
mvn eclipse: clean
Now refresh the project in eclipse or re-import.

maven plugin for eclipse, proxy issue

I use m2eclipse to integrate Eclipse (Indigo) and Maven. I also use a proxy, so I have a Settings.xml with the correct host and port. I've configured the LAN Settings of the OS too, so Eclipse is configured in the same way (Native mode). Finally, I have put an external maven as the Eclipse installation (Maven 2.2.1) .
Once I did that, I import from Eclipse a Maven project. When I do "mvn install" the artifacts are downloaded, and I get the "Build Succesfull". However, the project marks an error.
The error type is different if is a project with dependencies (pom dependencies) or a simple project. For example, in a simple project the error is "Could not calculate build plan: connection timed out". In a complex project doesn't read some artifacts, which are in the repository.
I think the problem is the plugin and the proxy because in the console appears when eclipse starts, "Unable to update index for central http://repo1.maven.org/maven2/".
Any idea?
Thank you for your help
Ángel
Since your build is working fine I believe your setting.xml is maven installation folder is working fine.
So try to change the maven setting in eclipse as shown below and refer the same setting.xml that is there in the maven folder configuration.
Not a very helpful answer, but I ran into the same problem.
m2eclipse didn't seem to handle proxies (either eclipse or .settings) very well.
My workaround at the time was to always have a command line handy to pull in new dependencies.
I had the same problem with the Maven error: Could not calculate build plan: connection timed out
What finally fixed it was a complete Clean and Rebuild:
Project > Clean...
(x) Clean all projects
(x) Build the entire workspace

Issue with importing projects generated with Maven into Eclipse Indigo

I have problem importing projects into Eclipse Indigo, generated by Maven2 on the commandline by using mvn eclipse:eclipse -Dwtpversion=2.0
Everything works fine on Eclipse Helios, my projects are imported, no compilation errors at all.
Helios uses "artifactId" from my pom.xml as the name of the project. It seems as if Indigo uses the name of the directory instead of the name of the artifactId for the name of the project.
Has anyone experienced something similar? If so, what was the solution?
EDIT: I did notice there is a difference in embedded Maven in Eclipse: Helios (and older versions of Indigo) use 3.0-SNAPHSOT whereas the latest Indigo uses 3.0.2 . Could that be the reason?
Thank you,
Jan
Ok, I found out what the problem was. Maven is not to blame, it is an Eclipse thing. There has been a discussion about whether it is a bug or not here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=344337
The answer is: Check out project files in a new SUBDIRECTORY in your workspace. Then everything works as it should, project name gets imported correctly. If you checkout, build and import your project files IN the workspace, Eclipse ignores project name in .project file.

Eclipse 3.7, m2eclipse & losing artifacts after changing pom.xml

I have a bit of a problem with Eclipse and Maven for a few months. After changing the pom.xml, Eclipse is losing all artifacts and getting this exception in my Maven console:
Missing artifact commons-logging:commons-logging:jar:1.1:compile
Eclipse doesn't find any artifacts. My workaround is to close Eclipse, run mvn clean install on the command line and start Eclipse. This workaround works without any problems, but is not really the right way. How can I fix this issue?
I'm running Eclipse 3.7 and the newest m2eclipse(-extra), Windows 7 64bit with JDK 1.6.0.24.
I assume it builds ok when Maven is explicitly run - yes?
Have you tried right-clicking on the project and selecting
Maven..Update Project Configuration
and
Maven..Update Dependencies?
If not, that's likely to solve your problem.
Are you also running
mvn eclipse:eclipse
I had a similar issue and I ran that, the refreshed the project in eclipse and everything worked fine.