Maven child module profile

I have a maven multi-module project. The parent has a test profile and includes child a in the profile itself.

  • If I run mvn -P test from child module, will parent's "test" profile get executed?
  • What if I want to provide a test profile for a specific child module only?

  • No. A child inherits the configuration from the parent, but it's not a buildchain relationship. While, since you have specified the child as a module, the child will be built when the parent gets built, from the point of view of the child in this case, the parent is another dependency of type "pom".
  • You just execute the build for the child with your test profile.
  • Note that:

  • you would able to see it for yourself just by building your project,
  • inheritance (children) and aggregation (modules) are separate concepts in Maven.
  • 链接地址: http://www.djcxy.com/p/62126.html

    上一篇: 防止未使用激活的配置文件构建Maven模块

    下一篇: Maven子模块配置文件