maven-surefire-plugin include/exclude precedence

后端 未结 2 658
眼角桃花
眼角桃花 2021-01-01 12:42

When using the maven-surefire-plugin and both includes and excludes, which order are they processed in? Furthermore, if you have 3 sets of tests, the first being the base s

2条回答
  •  爱一瞬间的悲伤
    2021-01-01 13:30

    I couldn't find official documentation about surefire plugin, but indeed the exclude-override-include is a common approach and is also applied by Maven in other similar contexts, like for resources.

    The only official an related info (I found) comes from the official Maven POM Reference documentation, here:

    includes: A set of files patterns which specify the files to include as resources under that specified directory, using * as a wildcard.

    excludes: The same structure as includes, but specifies which files to ignore. In conflicts between include and exclude, exclude wins.

    NOTE: I added the final bold formatting on the interesting statement.

    So more than probably the same approach is used across official maven plugins (in general, all the plugins having the org.apache.maven.plugins groupId and maven- prefix as artifactId).

提交回复
热议问题