2

Similar issue to this issue but it seems to be a maven/eclipse project issue.

I am using eclipse neon to check out from git, like this:

  • File -> Import
  • Maven -> Check out Maven projects from SCM
  • Now give it the url as below: enter image description here

I am using the following public github repo and I am seeing that Maven m2e during git checkout is not working, I get issues like the screenshot here where "import org.springframework.*" items are not being imported. All of this "just works" when I build with "mvn clean install" from the commandline, but is failing inside eclipse:

unable to to import spring

I have tried to refresh, and can't figure out any other action which might clear this issue up from inside "m2e" (maven to eclipse) integration in Eclipse Neon.

The projects appear to have "maven nature" but are not buildable. I checked in the project properties and I don't see any errors in the Builders or Java Build Path. I also tried this with Eclipse Mars.2 and had no luck with it either.

Community
  • 1
  • 1
Warren P
  • 65,725
  • 40
  • 181
  • 316
  • Probably your projects are not imported as Maven projects, as you just checked them out. Try `right click>maven>enable maven nature` or `right click>configure>convert to maven project`. If that doesn't work then delete the project and import it as an `Existing maven project` – 11thdimension Jun 22 '16 at 19:58
  • I used the maven "import" feature. – Warren P Jun 22 '16 at 19:58
  • Try removing everything but `pom.xml` and `src` before importing – 11thdimension Jun 22 '16 at 20:00
  • I am trying to use the feature that does the git checkout and then "just works". Is that impossible? – Warren P Jun 22 '16 at 20:01
  • The project may have some project specific files like `.classpath` `.settings`, these are used by Eclipse they're not cleaned before importing a project, they're used to configure it. A clean import should be fastest way to make sure if there's anything wrong with the Eclipse itself. – 11thdimension Jun 22 '16 at 20:04
  • Is this a standard practice documented anywhere? – Warren P Jun 22 '16 at 20:05
  • 1
    I don't know if it's a practice anywhere, but I have long since given up on understanding why Eclipse does what it does when importing a project. It's just how I tackle it. May be someone will provide a better solution here. – 11thdimension Jun 22 '16 at 20:11
  • 1
    First, make sure your pom.xml doesn't contain an error. Open it with the M2e pom editor inside Eclipse IDE, and fix all errors that can be reported. Some errors in the pom.xml can prevent dependency resolution from happening. Once your pom.xml is clean, try `Right-Click > Maven > Update Projects...`. – Mickael Jul 19 '16 at 10:06
  • `Maven > Update Projects` above should bring my Workspace setup in line with the Maven pom.xml content and fix this? If so, then that's the answer to this question. – Warren P Oct 14 '16 at 13:33

0 Answers0