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

后端 未结 5 849
一生所求
一生所求 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:36

    The parent pom and its version does have to be declared in the children.

    If your projects have a parent declared, it must be available either in the build so one of the modules must be the parent pom, or in a repository. You seem to be saying you want someone to checkout a project that depends on a parent, but not have access to the parent and still be able to build the project which is like trying to build a project without its dependencies.

    You're options to make the parent pom available are:

    • Set up a public maven repository, deploy the parent pom to it, and put the repository information in the child poms.
    • You can tell maven to look for the parent pom on a relative path before it checks repositories (this is to help you when you have local changes to the parent pom, not yet deployed). So you could concievably do an svn:external or its equivalent in your child project to your parent pom.

提交回复
热议问题