I\'m learning maven on the fly while doing work on a project with a large set of projects to build.
Currently a line in the main build uses an absolute path to speci
Ideally the pom.xml
should be in the same directory as your src
directory. For eg suppose you have checked out your project from svn into a folder C:/work/project
, then keep the main pom.xml
in C:/work/project
. src
should also be in C:/work/project
.
Your other subprojects should be in C:/work/subproject1
, C:/work/subproject2
and so on each having their own pom.xml
. Then in the main pom.xml
you can refer to the other projects in the
<modules>
<module>../subproject1<module>
<module>../subproject2<module>
</modules>
With Maven, things are relative to the directory containing the pom.xml
(which is represented by the ${basedir}
property and is called the base directory). There are however some situations where you could have to specify a relative path:
<parent>
pom is not directly above a given module using a <relativePath>
element (see this example)<module>
elements (like in this example). Having all that said, I'm not sure to understand what your situation exactly is or what you are describing.
Maybe you should show the relevant parts of your POM if this is possible.