views:

72

answers:

1

Inside the folder 'ProjectName' exists several subfolders, and of them contains java program:

  • ProjectName
    • Specifications
    • JavaCode
    • Gfx
    • ...

JavaCode folder contains pom.xml.

I have installed m2eclipse (0.10.x) to Eclipse and imported whole ProjectName folder to Eclipse. Subfolders are displayed correctly but maven integration is not working correctly - for example I don't see src/main/java "shortcut" folder in Eclipse, but I have to click to open all folders.

If I create a new maven project with Eclipse from scratch, the integration works well.

What could be the issue?

+1  A: 

Select the JavaCode folder and then invoke File... / Import... / Maven Project. That would bring your Java code into Eclipse as a proper project with Maven support enabled. It is fine to import several overlapping folders. So, you could use the parent for version control purposes and JavaCode would be the actual Java project you'd work with in the IDE.

Unfortunately there is no way around that, unless you want to move your pom.xml to the root project and remap all the Maven plugins to folders under JavaCode project. But that would be really bad idea and Maven integration for Eclipse may not work with such project structure without an additional tweaking.

Eugene Kuleshov
I forgot to mention that the reason why I would like to import the whole ProjectName folder to Eclipse is, that otherwise Eclipse does not know that git is used as SCM (because .git folder is under ProjectName). Otherwise I could import just that folder.
tputkonen
It is fine to import several overlapping folders. So, you could use the parent for version control purposes and JavaCode would be the actual Java project you'd work with in the IDE.
Eugene Kuleshov
I tried that, but it's very clumsy to use one project for editing the code and the second for viewing which files have been modified.
tputkonen