Harshana
Harshana

Reputation: 7647

m2e maven eclipse plugin not configure the build path

I import a project to my workspace and convert it to Maven project using m2e and ran the pom file with goal specify "clean install".

But my project build path is not populating with the jars already downloaded to my local repository which still gives compilation errors in the source.

When i expand "Maven Dependency" variable in the library tab of build path, i can not see the jars already downloaded?

Upvotes: 1

Views: 3474

Answers (1)

wool.in.silver
wool.in.silver

Reputation: 556

Was there existing Eclipse metadata when you imported the project, perhaps from another developer? This is a frequent cause of failure in Eclipse, especially if you have metadata from the earlier m2eclipse plugin.

I have encountered the situation many times (in Juno and Kepler) where the .classpath is incorrect, resulting in the symptom you describe, and I either have to rewrite the .classpath myself or nuke it and encourage Eclipse to try again.

In your case:

  • delete the project from your Eclipse workspace (but not the filesystem)
  • delete the subdirectories .settings and target, and the files .classpath and .project from the project directory
  • re-import the project into Eclipse via File -> Import... -> Existing Maven Project

The Eclipse dot-directories will be created from scratch, and the project should already be configured as a Maven project; artifact retrieval should start in the background.

If this fails, check the 'Maven Console' in Eclipse for clues, and/or the Eclipse Error Log.

As other people have commented, you need to ensure that your m2 settings file is being correctly interpreted by m2e.

Can you build successfully from the command line?

Upvotes: 3

Related Questions