简体   繁体   中英

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?

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM