문제

I have maven project and assume it looks like that

pom-parent
--pom child1
--pom child2
  • In pom parent I have defined plugin configuration for surfire plugin in default build. In pom parent I have defined profile integration-test with surfire plugin but different configuration.
  • In childs pom I override configuration of surfire plugin in default build(not in profile section), by adding combine.self in configuration tag default build(not in profile section).

My question is if I run mvn clean install -Pintegration-test what configuration for surfire plugin on each level will be applyied?

  • pom parent =>(default or that from profile?) pom
  • pom child1 =>(profile configuration will be overrited by default childs configuration?)
  • pom child2 => (same as for child1?)
도움이 되었습니까?

해결책

After googling I got the answer to my question. This article is very helpful to understand how merging in maven wokrs.

Very helpful command mvn help:effective-pom fired form parent level.

Basically for my question the answer is.

The parent pom will have configuration defined in profile, but when we define in profile configuration for plugin in tag <pluginManagement> it will be inherited to all children(even if they do not define their plugin configuration in profile, but they define it in simple plugin ->configuration space in default build tag) and merged with theirs configuration according to above article and strategy that we apply in children's poms.

I home it will someday help somebody with the same issue.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top