Class BannedDependencyType

  • All Implemented Interfaces:
    org.apache.maven.enforcer.rule.api.EnforcerRuleBase

    @Named("bannedDependencyType")
    public class BannedDependencyType
    extends AbstractPomCheck
    Performs checks on the type specified for dependencies in pom.xml files. For example in XWiki Standard we want to prevent extension with package jar and webjar to depend on xar extensions but only if the module does not ends with -test-docker or -test-tests. To achieve this you would use:
     
       <rules>
         <validateDependencyVersion implementation="org.xwiki.tool.enforcer.BannedDependencyType">
           <projectPackaging>jar</projectPackaging>
           <dependencyType>xar</dependencyType>
         </validateDependencyVersion>
         <validateDependencyVersion implementation="org.xwiki.tool.enforcer.BannedDependencyType">
           <projectPackaging>webjar</projectPackaging>
           <dependencyType>xar</dependencyType>
         </validateDependencyVersion>
       </rules>
     
     
    Since:
    14.6RC1, 14.4.3, 13.10.8
    Version:
    $Id: 60f4c464476a9ed81b7d8f0f0167fe0bbff699a9 $
    • Constructor Detail

      • BannedDependencyType

        public BannedDependencyType()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.enforcer.rule.api.EnforcerRuleException
        Specified by:
        execute in class org.apache.maven.enforcer.rule.api.AbstractEnforcerRule
        Throws:
        org.apache.maven.enforcer.rule.api.EnforcerRuleException
      • setLog

        public void setLog​(org.apache.maven.enforcer.rule.api.EnforcerLogger arg0)
        Specified by:
        setLog in interface org.apache.maven.enforcer.rule.api.EnforcerRuleBase
      • getLog

        public org.apache.maven.enforcer.rule.api.EnforcerLogger getLog()