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

Document support for transitive dependencies in enforcer plugins

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Resolved
    • 1.3.1, 1.4
    • None
    • Documentation, Rule API

    Description

      In the past, enforcer plugins were able to get transitive dependencies with the following code (or similar):

      project = (MavenProject) helper.evaluate("${project}");
      Set<Artifact> artifacts = project.getArtifacts();
      

      However, as part of the fix for MENFORCER-156,

      requiresDependencyCollection = ResolutionScope.TEST
      

      was removed from the @Mojo annotation, and I believe it broke the above functionality:
      https://svn.apache.org/viewvc/maven/enforcer/trunk/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java?r1=1493565&r2=1499852&pathrev=1499852&diff_format=h

      Is this a regression in 1.3.1+, or is 'DependecyGraphBuilder' now the only way to get transitive dependencies?

      I believe this has caused MENFORCER-194, as well as broken the BanDuplicateClasses rule from extra-enforcer-rules, so I consider it a regression.

      Right now the only workaround I know of is to continue using the 1.2 version of the enforcer plugin.

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              pmv Paul Vonnahme
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: