Error Updating Maven Project under eclipse - eclipse

I got this error when update Maven Project under eclipse Eclipse Java EE IDE for Web Developers. (Version: Kepler Service Release 2)
An internal error occurred during: "Updating Maven Project".
Path must include project and resource name: /myProjectName
Thanks

rightclick project, remove maven nature (or in newer eclipse, "Maven->Disable Maven Nature")
mvn eclipse:clean (with project open in eclipse/STS)
delete the project in eclipse (but do not delete the sources)
Import existing Maven project
SOLVED THE PROBLEM

Related

How does Eclipse apply an Expose Package configuration to a Maven build?

How does Eclipse propagate Java 11 "Expose Package..." to the Maven target?
I am exposing a Java 11 module to ALL-UNNAMED using Eclipse: Properties -> Java Build Path -> Module Dependencies -> Expose Package...
Nothing is added to pom.xml with this configuration yet the project builds successfully.
Using Eclipse 2020-06, m2e's maven 3.6.3, maven-compiler-plugin 3.8.1 (this is the only explicit override in pom.xml). The rest is the "EMBEDDED" maven.
When I look at the Maven console and effective pom I do not see any compilerArgs (--add-exports...) added. When I run mvn from the command line I do get compiler failure as expected.
How does m2e propagate --add-exports to javac without it being visible to help:effective-pom target or Maven console?
In Eclipse when I click "Show JPMS Options..." it does display "--add-exports ...", but nowhere in the m2e debug output does this appear.

Eclipse Maven errors when I'm only using Gradle

I began to get errors after downloading Nodeclipse and creating a Gradle project with New Gradle Project -- sample project "Java Quickstart". Whenever I re-open Eclipse, I get this error:
"Updating Maven Dependencies" has encountered a problem. An internal
error occurred during: "Updating Maven Dependencies".
org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob$1
I have never used Maven, but I tried to investigate the error. When I try to open Preferences > Maven, or most (but not all) of its subfolders, I get:
Unable to create the selected preference page. An error occurred while
automatically activating bundle org.eclipse.m2e.core.ui (545).
I looked on Maven Central and there is no m2e folder in org/eclipse. I also looked in Eclipse/features for pom.xml files and I have folders starting with org.eclipse.m2e, but no org.eclipse.m2e.core.ui.
Edit:
I created a new workspace and got the same error message as soon as I created a New Gradle Project based on Java Quickstart sample project. I did this twice and the second time Eclipse logged an error. Some relevant lines from the stack trace:
Exception:org.osgi.framework.BundleException: Exception in org.eclipse.m2e.core.internal.MavenPluginActivator.start() of bundle org.eclipse.m2e.core
Exception:java.lang.NoClassDefFoundError: org/eclipse/m2e/core/internal/project/registry/ProjectRegistryRefreshJob$1
at org.springsource.ide.eclipse.gradle.core.wizards.NewGradleProjectOperation.createProjectContents(NewGradleProjectOperation.java:106)
First try to build your project from command line.
Enide 2015 by Nodeclipse has built-in Terminal Ctrl+Alt+T
run gradle build
or right-click build.gradle Run as -> gradle build
Then see and think
You are building with Gradle, so don't look at Maven preferences, but Gradle one.
Possibly you confused Gradle and Maven and made wrong preferences, you can try again in new workspace.

Cannot import existing Maven projects - Broadleaf

I'm trying to setup Broadleaf in my local machine, I'm following the getting started guide and I'm having an error on the step when I import existing Maven projects in eclipse Juno, I get the following error
An internal error occurred during: "Importing Maven projects".
org.eclipse.wst.common.componentcore.internal.impl.ReferencedComponentXMIResourceImpl cannot be cast to org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource
I tried to Google it but the only info I could get was this but wasn't helpful
Update Maven project internal error - ReferencedComponentXMIResourceImpl cannot be cast to JptXmlResource
Please help.
I got a work around. I Downloaded Eclipse Luna, then I ran mvn compile on the root pom from terminal, then I went back to eclipse to import existing Maven projects. Worked like a charm.
There is a solution posted to solve this cast exception in Eclipse Juno,
post here: Update Maven project internal error - ReferencedComponentXMIResourceImpl cannot be cast to JptXmlResource
by disabling the JPA Configurator in eclipse preferences,
Preferences -> Maven -> Java EE Integration -> Select active Java EE configurators -> disable 'JPA Configurator'
It worked for me. Hope it works for you.
Inside Maven Parents Folder in Package Explorer, goto DemoSite - > Right Click -> Maven -> Update Project. Then Import the project. Will work fine.

Maven Error While updating Dependencies

I have a maven project in which i am getting the following error. I am using eclipse IDE
An internal error occurred during: "Importing Maven projects".
Unsupported IClasspathEntry kind=4
I have followed below steps for resolving this error. The reason for this error is class path file located in your project folder.
Disable Maven Nature for your project ( If in eclipse, right click on the project --> Maven --> Disable Maven Nature).
Delete the class path file in your project folder.
Re- enable the Maven Nature Again (right click on project --> configure --> Convert to Maven Project).
Try to Maven clean, install and Run the project.
Here's a better answer: stop using eclipse.
Here's the eclipse bug page:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=394042
They seem to have no interest in fixing this issue, so if you require|prefer to use the command line for projects, then really there is no fix but to quit eclipse.

How can I generate-sources on project import/update with m2e

I used to add "generate-resources" to Maven's "Goals to run on project import" setting in older m2e.
Now I have new version of eclispe and m2e, and the setting is gone.
How can I add the generated-sources o the eclipse project automatically?
see this older question:
Problems by import of a multiple modules maven 2 project into eclipse workspace
I am using m2e 1.0.200.20111228-1245,
Eclipse version is as follows
Version: Indigo Service Release 2
Build id: 20120216-1857
Maven is: 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Pls. note that this is a centrally managed system, I have no root access etc.