Maven Enforcer Plugin
  1. Maven Enforcer Plugin
  2. MENFORCER-83

Banned dependencies should support regular expressions

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-1
    • Fix Version/s: 1.3
    • Component/s: Standard Rules
    • Labels:
      None

      Description

      The includes and excludes of the bannedDependencies rule support wildcards, but only for an entire section.

      They should be enhanced to support regular expressions.

      For instance instead of having

      <includes>
        <include>my.company:abc-api</include>
        <include>my.company:def-api</include>
        <include>my.company:ghi-api</include>
        <include>my.company:jkl-api</include>
      </includes>
      

      one would specify

      <includes>
        <include>my.company:.*-api</include>
      </includes>
      

      To be compatible, the wildcard '*' would be treated as regular expression '.*'

        Issue Links

          Activity

          Hide
          Robert Scholte added a comment -

          Fixed in r1489638

          Show
          Robert Scholte added a comment - Fixed in r1489638
          Show
          Vincent Massol added a comment - I have the exact same need. I've had to develop a custom enforcer rule that extends BannedDependencies, see https://github.com/xwiki/xwiki-commons/blob/73c8404f08ba36136d08c48bbacc9b88f04a07e6/xwiki-commons-tools/xwiki-commons-tool-enforcer-dependencies/src/main/java/org/xwiki/tool/enforcer/XWikiBannedDependencies.java Thanks!
          Hide
          Eric Lewis added a comment -

          Sorry, I wasn't aware of the syntax in JIRA.

          The last sentence should read

          To be compatible, the wildcard * would be treated as regular expression .*

          Show
          Eric Lewis added a comment - Sorry, I wasn't aware of the syntax in JIRA. The last sentence should read To be compatible, the wildcard * would be treated as regular expression .*

            People

            • Assignee:
              Robert Scholte
              Reporter:
              Eric Lewis
            • Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development