I'm using eclipse Kepler with the m2e plugin and I want to modify a maven project and compile it. I first converted it to a maven project with Configure -> Convert to maven project, but there were still many missing imports. When I use Run as... -> Maven install the project compiles.
How can I fix the missing imports?
Tell m2e to update the project: Context menu of the project / Maven / Update Project...
m2e will then read the POM again and update the classpath and build the project again.
Make sure you have this in your
.classpathfile:Note: The actual syntax might be slightly different depending on the m2e version that you use.
Another common pitfall is the scope
provided:Note the last part:
not transitiveThis means you depend on POM A which says "I need X:Y:Z, scope provided". Your project will see this dependency but it won't be on your classpath at all.
To fix this, copy the dependency into your project with the same scope (
provided).