I have build configuration for maven failsafe plugin which includes systemPropertyVariables
:
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<buildDirectory>${project.build.directory}</buildDirectory>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
Also I have a profile which can append few properties to same plugin via pluginManagement
:
<profile>
<id>test</id>
<activation>
<property>
<name>test.host</name>
</property>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<TEST_HOST>test.host</TEST_HOST>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
But I can't read properties from this profile. It's working fine if I delete systemPropertyVariables
in build plugin configuration section and keep in pluginManagement configuration of profile. It seems that I need to merge these properties when used together, so I tried to add combine.children="append"
and combine.self="append"
to configuration
of plugin, but it didn't help.
UPDATE:
I've found the cause of this issue: I didn't mention that I have parent pom including from this one, and parent pom.xml
has these lines:
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<version>3.0.0-M3</version>
<configuration combine.children="append">
<systemProperties>
<!-- some properties that I don't use -->
</systemProperties>
</configuration>
</plugin>
And these parent pom failsafe configuration is breaking all configs in my pom.xml
- if I remove parent pom reference, failsafe properties will be included correctly. I can't just remove parent pom reference and can't modify it (actually I can fork it and edit, but it's not an easy task), is it possible to override these properties, since I don't use them?
Attached minimal reproducible project: https://send.firefox.com/download/88dfb9f933c9567f/#71ij1jbuEuAYgdwIiZQZRg
mvn help:effective-pom -Ptest
? A quick try here, with exactly the XML above, showed both<buildDirectory>
and<TEST_HOST>
under<systemPropertyVariables>
– Colbycolbyepom.xml
– Kiel