Maven uses properties in relativePath

I have a maven project that refers to a module (subproject), the subproject has a parent section with relativePath that points to ../pom.xml

, and when I build from my dev machine everything works fine.

In my SVN, the folder structure is slightly different, my subproject folder contains a trunk folder and inside that folder are my sources.

My folder structure in SVN:

|-- pom.xml
|-- subproject
    |-- trunk
        |-- pom.xml
        |-- src


If I want to build my project on my CI server (teamcity) I need to change relativePath

to ../../pom.xml

. Are there other solutions for this without editing the pom.xml? Can I pass property from command line to relativePath

? I tried this way, but my input property is being ignored.



source to share

1 answer

If you run "mvn install -pl". first in the folder containing the parent pom (i.e. from the project directory in your svn structure) then maven build your subproject, the subproject won't need a relative path line at all. You can leave it, but it will be skipped as the installed version will be found by maven first from the repo. "-pl". option tells maven not to build submodules, just set the parent pom to your local repo.



All Articles