You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Paul Vonnahme (JIRA)" <ji...@apache.org> on 2019/02/14 23:26:00 UTC
[jira] [Commented] (MENFORCER-230) Document support for transitive
dependencies in enforcer plugins
[ https://issues.apache.org/jira/browse/MENFORCER-230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16768801#comment-16768801 ]
Paul Vonnahme commented on MENFORCER-230:
-----------------------------------------
Closing old issue. It looks like
{noformat}
requiresDependencyCollection = ResolutionScope.TEST{noformat}
was added way back in 1.4.1 and still exists in 3.0.0-M2
> Document support for transitive dependencies in enforcer plugins
> ----------------------------------------------------------------
>
> Key: MENFORCER-230
> URL: https://issues.apache.org/jira/browse/MENFORCER-230
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Components: Documentation, Rule API
> Affects Versions: 1.3.1, 1.4, 1.4.1
> Reporter: Paul Vonnahme
> Priority: Critical
> Labels: regression
>
> In the past, enforcer plugins were able to get transitive dependencies with the following code (or similar):
> {code:java}
> project = (MavenProject) helper.evaluate("${project}");
> Set<Artifact> artifacts = project.getArtifacts();
> {code}
> However, as part of the fix for MENFORCER-156,
> {code:java}
> requiresDependencyCollection = ResolutionScope.TEST
> {code}
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)