Параметры 'rules' для плагина maven-forcecer отсутствуют или недействительны - PullRequest
0 голосов
/ 08 мая 2019

Я пытаюсь использовать плагин Enforcer в многомодульном проекте с использованием принудительной цели.Мои конфигурации pom:

<executions>
    <execution>
        <id>default-cli</id>
        <!--<phase>initialize</phase>-->
        <goals>
            <goal>enforce</goal>
        </goals>
    </execution>
</executions>
<configuration>
    <rules>
        <dependencyEnforcerRule implementation="com.myCustomRule.CustomRule">
            <allowedDependenciesFile>whitelist.properties</allowedDependenciesFile>
        </dependencyEnforcerRule>
    </rules>
</configuration>

Если я запускаю mvn enforcer:enforce, я получаю сообщение об ошибке:

 Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce (default-cli) on project my-module-prj: The parameters 'rules' for goal org.apache.maven.plugins:maven-enforcer-plugin:1.4.1:enforce are missing or invalid 

Если я изменяю конфигурацию на

<id>test-id</id>
<phase>initialize</phase>

изапустите mvn initialize, все работает: сборка не удалась, потому что некоторые правила не сработали.

Как запустить плагин Enforcer с целью в многомодульном проекте?

...