Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-224

Regression from 1.3.1 to 1.4 with bannedDependencies rule

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.4.1
    • Component/s: Plugin
    • Labels:
      None
    • Environment:

      Description

      the attached pom, when running "mvn enforcer:enforce" in the project will work with the enforcer plugin 1.3.1 but fail with the enforcer plugin 1.4 with

      [,4\.11)
      ^
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
      Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.apache.maven.plugins:maven-enforcer-plugin:1.4:enforce failed: Unclosed character class near index 7
      [,4\.11)
      ^
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
      ... 19 more
      Caused by: java.util.regex.PatternSyntaxException: Unclosed character class near index 7
      [,4\.11)
      ^
      at java.util.regex.Pattern.error(Pattern.java:1924)
      at java.util.regex.Pattern.clazz(Pattern.java:2493)
      at java.util.regex.Pattern.sequence(Pattern.java:2030)
      at java.util.regex.Pattern.expr(Pattern.java:1964)
      at java.util.regex.Pattern.compile(Pattern.java:1665)
      at java.util.regex.Pattern.<init>(Pattern.java:1337)
      at java.util.regex.Pattern.compile(Pattern.java:1022)
      at java.util.regex.Pattern.matches(Pattern.java:1128)
      at org.apache.maven.plugins.enforcer.utils.ArtifactMatcher$Pattern.matches(ArtifactMatcher.java:148)
      at org.apache.maven.plugins.enforcer.utils.ArtifactMatcher$Pattern.match(ArtifactMatcher.java:113)
      at org.apache.maven.plugins.enforcer.BannedDependencies.compareDependency(BannedDependencies.java:149)
      at org.apache.maven.plugins.enforcer.BannedDependencies.checkDependencies(BannedDependencies.java:117)
      at org.apache.maven.plugins.enforcer.BannedDependencies.checkDependencies(BannedDependencies.java:76)
      at org.apache.maven.plugins.enforcer.AbstractBanDependencies.execute(AbstractBanDependencies.java:94)
      at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:150)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
      ... 20 more

      Mostly because the version inclusion / exclusion expressions are not regexps.

        Attachments

        1. ArtifactMatcher.patch
          9 kB
          Brian Jackson
        2. pom.xml
          1 kB
          Henning Schmiedehausen

          Activity

            People

            • Assignee:
              khmarbaise Karl Heinz Marbaise
              Reporter:
              hgschmie Henning Schmiedehausen
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: