0

I have imported my maven project in eclipse using Import Maven project. It got import in eclipse project explorer, but all the source folder are opening as files and folders, its not opening as java source folder. Since its opening as files and folder, it doesnot have compilation unit, found very difficult to code using it.

What do I need to do inorder to make the source folder as java source folder so that I can code easily?

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
Ramya
  • 1,067
  • 6
  • 16
  • 29
  • Are the source folders in the maven standard directory layout, i.e. src/main/java, src/test/java? – meriton Oct 10 '12 at 19:21
  • yes they are in standard layout – Ramya Oct 10 '12 at 19:29
  • 1
    Make sure: 1. m2e eclipse plugin (available via Eclipse Marketplace) is successfully installed. 2. pom.xml is well defined, no syntax error, typo and etc. – yorkw Oct 10 '12 at 20:06

2 Answers2

2

Select the project and from the context menu choose Maven -> Update Project Configuration (This menu item gets reworded across various maven releases so look for something similar). You may also need to choose Update Dependencies.

Chris Gerken
  • 16,221
  • 6
  • 44
  • 59
1

In the shell/command line, execute mvn eclipse:eclipse

ecbrodie
  • 11,246
  • 21
  • 71
  • 120