Class PedanticPluginManagementLocationEnforcer

java.lang.Object
com.github.ferstl.maven.pomenforcers.AbstractPedanticEnforcer
com.github.ferstl.maven.pomenforcers.PedanticPluginManagementLocationEnforcer
All Implemented Interfaces:
org.apache.maven.enforcer.rule.api.EnforcerRule, org.apache.maven.enforcer.rule.api.EnforcerRule2

public class PedanticPluginManagementLocationEnforcer extends AbstractPedanticEnforcer
Enforces that only a well-defined set of POMs may declare plugin management.
 ### Example
     <rules>
       <pluginManagemenLocation implementation="com.github.ferstl.maven.pomenforcers.PedanticPluginManagementLocationEnforcer">
         <!-- Only these POMs may declare plugin management -->
         <pluginManagingPoms>com.example.myproject:parent,com.example.myproject:subparent</pluginManagingPoms>
       </pluginManagemenLocation>
     </rules>
 
Since:
1.0.0
Enforcer Rule ID:
PedanticEnforcerRule.PLUGIN_MANAGEMENT_LOCATION
  • Constructor Details

    • PedanticPluginManagementLocationEnforcer

      public PedanticPluginManagementLocationEnforcer()
  • Method Details

    • getDescription

      protected PedanticEnforcerRule getDescription()
      Specified by:
      getDescription in class AbstractPedanticEnforcer
    • accept

      protected void accept(PedanticEnforcerVisitor visitor)
      Specified by:
      accept in class AbstractPedanticEnforcer
    • doEnforce

      protected void doEnforce(ErrorReport report)
      Specified by:
      doEnforce in class AbstractPedanticEnforcer
    • setAllowParentPoms

      public void setAllowParentPoms(boolean allowParentPoms)
      Indicates whether parent POMs are generally allowed to manage plugins.
      Parameters:
      allowParentPoms -
      Since:
      1.2.0
      Enforcer Configuration Parameter
      Default Value:
      false
    • setPluginManagingPoms

      public void setPluginManagingPoms(String pluginManagingPoms)
      Comma separated list of POMs that may declare <pluginManagement>. Each POM has to be defined in the format groupId:artifactId.
      Parameters:
      pluginManagingPoms - Comma separated list of POMs that may declare plugin management.
      Since:
      1.0.0
      Enforcer Configuration Parameter
      Default Value:
      n/a