There are two goals bound to the test phase of default Maven lifecycle. The first goal (in the order of appearance in the pom.xml) is:
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.4.1</version>
<executions>
<execution>
<id>update</id>
<phase>test</phase>
<goals>
<goal>update</goal>
</goals>
</execution>
</executions>
and the second is:
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.1</version>
<executions>
<execution>
<id>default-test</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
During the test phase, the surefire plugin is executed first, which contradicts with the Maven 3 FIFO ordering of goals in the same phase. I verified that the goals have the same order in the effective pom. Is it possible that one of the plugins is overriding the default order? Why is the surefire plugin executed before the liquibase one?
You are right that Maven executes the goals in the order as they are defined in the POM but in this special case, you used the default-test
identifier for the second execution, which has a special meaning.
I can't find any reference about this behaviour right now but changing your <id>
to something else will restore the behaviour you expect.
However, for this special case again, changing the id will make the maven-surefire-plugin
execute twice: it is already executed by default and adding an execution (with an id different than default-test
) will add another instead of overriding the default one.