Maven - making child projects that can be independent of their parent

后端 未结 5 864
一生所求
一生所求 2020-12-23 17:01

I\'m a bit of a Maven newb, and I\'m trying to setup a maven project that builds several child projects, but still allows someone to just grab one of the child projects and

5条回答
  •  旧巷少年郎
    2020-12-23 17:46

    The sub-projects are only dependent on the parent if they use the tag (maven inheritance). You are not required to use the tag in submodules. However, if you want your modules to inherit common elements from the parent pom, then you have to use maven inheritance.

    Strictly speaking, if you are using inheritance and want to build only a sub-project, then the parent pom.xml doesn't have to be present in the parent directory; as long as maven can find the parent pom in a local or remote repository, then it will build. In practice, if there are changes going on in your parent pom, you'll have to work out how to get your team members to keep up to date with the parent pom.

提交回复
热议问题