Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Creating and editing a parent POM in the workspace directory?

Typical workspace filesystem directory structure looks like


  workspace/
    parentA/
      moduleA1/
        pom.xml
      moudleA1/
        pom.xml
      pom.xml
    parentB/
      ...


During project import m2e will logically (!) flatten nested directory
structure and create workspace projects parentA, moduleA1, moduleA2, etc.

m2e will properly link parentA/pom.xml to all module projects that use
it as a parent, and all changes to the parent pom will be immediately
applied to the modules.


And you probably want to update to recently released m2e 1.2, you can
find info how to install it on m2e download page [1]

[1] http://www.eclipse.org/m2e/download/

--
Regards,
Igor

On 12-09-25 6:28 PM, Steinar Bang wrote:
Platform: debian testing ("wheezy"),
           eclipse 3.8.0,
           m2e 0.12.1.20110112-1712 (installed from http://m2eclipse.sonatype.org/sites/m2e )

The natural thing for maven projects in a workspace, would be to have a
parent POM in the workspace itself.

Is there a way to create and maintain a pom.xml file in the workspace
directory, using m2e?  And if so: from which version?

Here is what I've found out:
If there is a parent POM in the workspace directory, when you create a
new maven project, the parent POM will be used in the new project, and
the new project will become a module in the parent POM.

But there is not (at least I haven't found) any way to create the parent
POM from inside m2e or eclipse...?  Is there a way to do this in newer
versions of m2e?

Also, opening the parent POM from the m2e POM editor on the pom.xml file
of the project, won't work.  You get a dialog saying "Could not resolve
artifact".

Presumably this means that you could see the parent POM if you haved
done "mvn install" in the workspace to install that POM in your local
repository...?  But even if you could open the parent POM in that case,
you would be editing the wrong POM (a copy, not the original file).

The eGit explorer will let you open the workspace pom.xml file in an
editor (which by default is the m2e POM editor).  But the eGit explorer
won't let you create a pom.xml file if there isn't any there.

Neither the Project Explorer nor any of the other explorers that relate
to workspace and projects, will let you see anything in the workspace
itself.

Thanks!


- Steinar

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top