Maven Plugin Error in Eclipse oxygen - eclipse

Can anyone help me with this?
Could not calculate build plan: Plugin
org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
I tried the following ways:
Right click on project. Go to 'Maven' and click on update project. Click on OK.
Close the project in Eclipse. Delete the project in Eclipse ( but not the contents ). Navigate to the project in file system and delete .classpath and .project files. Go back to Eclipse and import the project as "existing maven project".
Please suggest.

I think this is what it helped me when I was facing
You can right-click on your project
Select Maven > Update Project
Select "Force Update of snapshots and release"

Related

Maven project appearing as path

I have 3 Maven projects, but the 3th is appearing like a path in Eclipse. How do I set to Eclipse understand that Project 3 is a Maven Project, not a path?
EDIT: This occurred after I switch for other branch at GitLab
I solved this by clicking on Project3 with the right button of the mouse, click on Import, select Existing Maven Projects, select my project and Finish.
EDIT: you can also select Import as project

Automatically update a maven project under eclipse, after a svn-checkout

After checking out a maven project from a svn-repository, eclipse shows dependency-errors.
To solve the problem,
I have to right-click on the project-folder,
then I have to click Maven --> Update Project
After doing that, the dependendicies of the pom-file are downloaded and the specific classpathes are set.
The problem: I have to do this everytime after a checkout of a maven-project.
My question: Why should I have to update manually the maven-project? Why didn´t do this the maven-builder automatically? Is there any way to engage eclipse or the maven-builder to do this automatically?
If you have Subversive (installable via the Marketplace), you can checkout and set up the project in one step from Eclipse. In the dialog File -> Import try the entry Maven -> Check out Maven Projects from SVN.
Unfortunately, maven project configurations tend to get stale when you're changing stuff in the POM. Another tip from me is use the keyboard shortcut for "Update Project" (Alt-F5 on Mac & Windows) which should select the project you're currently in and has the option to update all projects at once.

How to checkout maven project from svn repository

I am new to Maven and Eclipse, I need to check out an existing Maven project from a SVN repository. I have installed the M2E plugin and the subversion plugin and they seem to be working properly. Here are the Installation Details -->
When I right click in the project explorer and select Import -> SVN -> Project from SVN, then select the repository location and click finish, I am prompted with 4 possibilities
What is the procedure for checking out a Maven Project from this point on, or am I on the right track here?
Thanks for your help in advance!
tl;dr : Check out this video. The portion between 1:04 and 1:50 should answer your question (To skip to the interesting part, click on the youtube player and press 4).
You already have the SVN connector for m2e installed. Thus it should be possible to Import Existing Maven Project from the SVN repository.
From the options you have listed in the above snapshot, you should be able to proceed after selecting the First or the Fourth option i.e. :
(according to Mauno V's suggestion below) To convert this imported project into a Maven project Right Click on it and do a Configure -> Convert to a Maven Project like so :
If you have Pom project as a root branch, after project checkout completed, you may do it with import project as 'Existing Maven Project' and set the project as root project, and finish!
you should be able to see your module define as project in eclipse project explore, and eclipse will recognized as module project.
do right-click on Pom project, Maven -> Update Project or Alt+f5 to refresh and see the content project.

An internal error occurred during: "Updating Maven Project

when i convert to maven project the error is :
> An internal error occurred during: "Updating Maven Project".
> Unsupported IClasspathEntry kind=4
what's the problem?
This is all you need:
Right-click on your project, select Maven -> Disable 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”
Here is what worked for me:
After the steps posted in Answer 21 above (the last being Convert to Maven Project),
I did:
mvn eclipse:eclipse - this regenerates your .project and .classpath files (both of which were blown away by mvn eclipse:clean in step (2) above)
In Eclipse, I right-clicked my project(s) and then Maven > Update Project
I did not see the Unsupported IClasspathEntry kind=4 message anymore :)
As posted here, the problem is the command line eclipse project generation. So, do not use mvn eclipse:eclipse instead do:
delete your project from eclipse (without deleting it from your file system)
do mvn eclipse:clean in your command line inside your project folder
delete .classpath .project .settings in your project folder (if they still exist after doing 2.)
in eclipse import your project as an "Existing Maven Projects" and it should work flawlessly
Revert back to an earlier commit/change fixes the problem.... so it could be some corrupted project/mvn file issue, somehow. So, I followed the steps to clean up and then import the project.It worked after a couple attempts.
An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4
Right-click on your project, select Maven -> Remove Maven Nature.
2.Open you terminal, go to your project folder and do “mvn eclipse:clean”
3.Right click on your Project and select “Configure -> Convert into Maven Project”
also delete project from eclipse. and run:
mvn eclipse:clean
then import project again.
In my case the problem was a .settings-folder commited to svn. it contained the wrong settings (in my case the jdk was set to wrong location).
So deleting .settings on svn and doing a clean checkout did it.
Following worked for me:
Right-click project, select Maven -> Remove Maven Nature.
Close Eclipse
go to project folder on command prompt and do “mvn eclipse:clean”
Start Eclipse
Right click on Project and select “Configure -> Convert into Maven Project”
I meet the same problem before when I import a project as a maven project. what I did is like is right click project and choose Maven -> Update Project... (Alt-F5) on the context menu. In the Update Maven Project dialog, ensure that "Update project configuration from pom.xml" is checked. Then press OK.
The issue should be resolved.
Another way is, you go to Problem tab, and find the Error, there is a hint saying that right click it and use Quick fix to resolve the problem.
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://download.eclipse.org/technology/m2e/milestones/1.6/
Switch to terminal and type command mvn eclipse:clean
Right-click on you project, select Maven -> Update Project
Okay, everything is settled

eclipse project not importing the jar packages in local Maven repository

I am facing a problem in setting my eclipse project.
The problem is whenever I am creating a new project and import the code.Eclipse is not resolving the packages which are present in the jar files which are present in the C;/..../user/.m2/repository.
Hence it's giving a lot of compilation errors until I add all the required jar files manually in the build-path by going to "Add External Jars"
I saw that M2_REPO is present in my Eclipse classpath.But still it is not resolving the packages.
Please suggest how this problem can be resolved.
Gaurav
I've been having a similar error in Eclipse on OSX. In Eclipse on the Mac, there is no "Maven" entry when you right-click on a project in the explorer.
However!
I just discovered that if I right click and then click "Validate", it suddenly magically resolves all the dependencies. No idea why, but maybe this will help.
I've had this issue on Eclipse Kepler EE which comes prebuilt with m2e, I finally got it working by doing the following on each project:
Right click on the Project
Select Properties
Select Maven
Uncheck the option that says: Resolve Dependencies from Workspace projects
It should pop up with a box that says Maven setting has changed. Do you want to update project configuration. Click Yes to this.
To confirm:
Right click on the project
Select Properties
Select Java Build Path
Check the Libraries tab under Maven dependencies that all the jar you
expected are now there.
close your project, and remove your project settings files: .project, .classpath, .settings/. Then re-import this project. It will be ok.
Though this answer is late. But it can help the future audience.
You can give it a try using Project(Right-Click) -> Maven -> Update Project. To select all or the number of projects you want to update.
This worked for me.
Have you put all needed dependencies in the pom.xml? Even if the Jars are already in your local repository, each project needs its dependencies mentioned in the pom.xml to resolve the dependencies. If you do that, m2eclipse will automatically resolve the build path.
Another possibility. Are you running Eclipse using JDK or JRE - the default is JRE. You will see a warning in Eclipse console, if so.
maven eclipse plugin will not work correctly unless run with JDK.
I just had a similar problem. The JDK was there, the problems view was set to Show All, and yet there were hundreds of unresolved type errors. Not even Refresh (F5) would work.
In the Project|Properties|Java Build Path|Libraries window I was seeing only the JRE System Library, but not the desired "Maven Dependencies" entry. And "Maven Dependencies" was also missing from the Package Explorer view as well.
I finally fixed this by right clicking on the project in the Package Explorer, selecting Maven from the menu, then selecting "Update Project Configuration." This added "Maven Dependencies" and all the errors went away.
This was nice because prior to this fix I had to treat Eclipse like a dumb editor and run mvn compile on the commandline to find errors.