multi module maven project with parent pom and svn layout

后端 未结 2 1992
梦谈多话
梦谈多话 2020-12-30 08:03

I currently have about 16 projects that I build with maven that get deployed to the same application server that make up something like a \"portal\". I have built a parent p

相关标签:
2条回答
  • 2020-12-30 08:42

    A variation to JohnS's approach would be to use svn:externals to hook appropriate trunk/tags/branches of your subprojects to the appropriate trunk/tag/branch of your parent project. In this way checking out one variant of your parent would pull out all the right version of the other projects.

    This makes sense only if it's reasonable to checkout all your projects together.

    0 讨论(0)
  • 2020-12-30 08:58

    You can use following layout:

    +parent-project
      pom.xml
    +child-project-1
      pom.xml
    +child-project-2
      pom.xml
    

    In parent project pom add:

    <modules>
        <module>../child-project-1</module>
        <module>../child-project-2</module>
    </modules>
    

    In children projects pom add:

    <parent>
        <artifactId><!-- parent artifactId --></artifactId>
        <groupId><!-- parent groupdId --></groupId>
        <version><!-- parent version --></version>
        <relativePath>../parent-project</relativePath>
    </parent>
    

    Children Projects can optionally be dependent.

    Following links may also help:

    • http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
    • Maven parent pom vs modules pom
    0 讨论(0)
提交回复
热议问题