Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Resolved
-
1.3.1, 1.4
-
None
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
- is broken by
-
MENFORCER-156 Upgrading maven-enforcer-plugin from 1.2 to 1.3 breaks maven-assembly-plugin
- Closed
- relates to
-
MENFORCER-194 Rule RequireSameVersions: dependency artifacts are not checked
- Closed