[
https://issues.apache.org/jira/browse/MENFORCER-397?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Slawomir Jaranowski closed MENFORCER-397.
-----------------------------------------
Fix Version/s: next-release
Assignee: Slawomir Jaranowski
Resolution: Fixed
> allow no rules
> --------------
>
> Key: MENFORCER-397
> URL: https://issues.apache.org/jira/browse/MENFORCER-397
> Project: Maven Enforcer Plugin
> Issue Type: Improvement
> Components: Plugin
> Affects Versions: 3.0.0
> Reporter: Delany
> Assignee: Slawomir Jaranowski
> Priority: Minor
> Labels: up-for-grabs
> Fix For: next-release
>
>
> Allow no rules by adding property similar to
> [http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#failIfNoTests]
> Currently the execution fails
> {quote}No rules are configured. Use the skip flag if you want to disable
> execution.
> {quote}
> For some background, my strategy in dealing with lots of XML is to configure
> plugin executions upfront with an id, goal, and default properties, and then
> allow modules to populate them with the minimum e.g.
> {code:java}
> <executions>
> <execution>
> <id>fail</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <fail>true</fail>
> </configuration>
> </execution>
> <execution>
> <id>warn</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <fail>false</fail>
> </configuration>
> </execution>
> </executions>
> {code}
> and then
> {code:java}
> <executions>
> <execution>
> <id>warn</id>
> <configuration>
> <rules>
> <requireProperty>
> <property>remote.name</property>
> <message>Distribution profile invoked without setting a
> remote.name: repositories may not be configured correctly</message>
> </requireProperty>
> </rules>
> </configuration>
> </execution>
> </executions>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)