Eclipse + Maven + Git + Multi-Module projects = Unhappiness

前端 未结 4 2205
别跟我提以往
别跟我提以往 2021-02-19 23:21

We\'ve got a multi-module project using Eclipse and Maven. The only way I could get it to work in the past was to use a flat layout for the projects, where the parent module was

4条回答
  •  攒了一身酷
    2021-02-19 23:34

    A standard Maven multi-module structure as a single git repo works perfectly fine for me in Eclipse Indigo with M2e and the git plugin that shows up in that environment. You can't ask Eclipse to do your fetching for you, but once you've pulled from command line, you use Team/Share, say 'Git!' and all is well.

    I think I see what's the source: hierarchy is a problem for projects inside the workspace, not 'existing projects' that you import.

    Here's a typical workflow:

    1. use git svn clone to get a tree. it's a stock, hierarchical mvn multi-module tree
    2. in eclipse, use import/maven/existing maven project. Point at the whole tree
    3. select all
    4. OK

    it works fine. The nesting does not disturb eclipse one bit. I don't know what problem that bz is pointing at.

    Before I used m2e I used the maven-eclipse-plugin. And it also worked in these cases, because it does not generate a .project/.classpath for pom aggregating projects, so Eclipse is never called upon to actually nest anything.

    I'm not alone -- see the developer setup instructions as cxf.apache.org for an open source example that you can try for yourself.

提交回复
热议问题