如何创建pom作为父子关系

时间:2013-10-17 07:32:59

标签: java spring maven

hii i am working on maven i have a situation where i have some layer in my project now i need to layer the poms 
i have top 
Service layer
 >1 presentaion layer
    >> usermanagement

 >2 Application layer
    >> usermanagement

 >3 Business deligatyes
    >> usermanagement

 >4Data Access layer
    >> usermanagement
    >> dataaccessframework

here in this structure i need tu put the dependency of DATAACESSLAYER into BUSINESSDELEGATES and business deligates into application layer and application layer into presentation layer
and all have modules and has relation with parent and child

soo now i need to set the packaging elemnt of these poms

i have set all internal child pom are as JAR
and outer means layer pom as POM 

但是当我把依赖放入另一层pom时,它要求jar     但是当我将图层包装设置为jar时,它在parnt child relation soo中有问题,请帮助管理这个架构     最后我想要一个来自presntation layre的战争文件

请建议我做这个关系

1 个答案:

答案 0 :(得分:0)

在项目目录中放置一个基础pom。这也应该作为项目所有模块的父pom。您的项目结构应该是

/project-name
  /pom.xml --> this is the parent pom, include names of all modules here
/project-name/presentation-layer
 /pom.xml --> inside this pom declare its parent 
/project-name/data-access-layer and so on.

对于包装,项目中有另一个模块捆绑罐子并创建分发(战争等)。使用maven-assembly插件执行此操作。