How to make maven build of child module with parent module?

后端 未结 2 595
我在风中等你
我在风中等你 2020-12-16 16:07

I have multiple modules in my project and they are dependent on each other either directly or transitively. When I maven build «Project A» some where «Project D» gets build

2条回答
  •  太阳男子
    2020-12-16 16:52

    You need to create an aggregator project. See the link for more information on the aggregation concept.

    Basically, you create a parent project containing several "modules". When building the parent, the modules automatically gets built as well.

    If you declare dependencies between the modules, Maven will automatically build the different modules in a correct order so that if «Project A» depends on «Project B», «Project B» is built first and then «Project A» is built so that its artifact is available for the building of the second artifact.

    See also this question from the Maven's FAQ.

提交回复
热议问题