Các cấu hình nói đúng cách không được kế thừa trong các cấu hình được xác định trong pom mẹ không có sẵn trong poms của con, theo tài liệu maven. BAO GIỜ, các thuộc tính và các plugin xây dựng (không phải pluginManagement) được chỉ định trong poms cha có thể được kích hoạt và do đó sửa đổi môi trường xây dựng cho các poms con. Ví dụ nếu tôi có cha mẹ pom A, trong đó có các cấu phần sau:
</profiles>
<profile>
<id>integrationTest</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<parallel>none</parallel>
<excludes>
<exclude>**/*Test.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes
<include>**/*IT.java</include>
</includes>
<!-- need to exclude nothing as it is possible that some by default some tests are excluded and we need to override that -->
<excludes>
<exclude>none</exclude>
</excludes>
<parallel>none</parallel>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Và sau đó một pom con B mà không có Plugin failsafe cấu hình trong xây dựng mặc định nhưng được thừa hưởng từ A pom qua thẻ cha và sau đó tôi chạy 'mvn clean install -P integrationTest' từ thư mục con pom, nó sẽ lấy thông tin về plugin được chỉ định trong A.