1919package org .apache .maven .plugins .dependency .resolvers ;
2020
2121import java .io .File ;
22- import java .util .LinkedHashSet ;
23- import java .util .Set ;
2422
25- import org .apache .maven .artifact .Artifact ;
2623import org .apache .maven .plugins .annotations .Parameter ;
2724import org .apache .maven .plugins .dependency .fromDependencies .AbstractDependencyFilterMojo ;
28- import org .apache .maven .plugins .dependency .utils .DependencyUtil ;
29- import org .apache .maven .project .ProjectBuildingRequest ;
30- import org .apache .maven .shared .artifact .filter .collection .ArtifactIdFilter ;
31- import org .apache .maven .shared .artifact .filter .collection .ClassifierFilter ;
32- import org .apache .maven .shared .artifact .filter .collection .FilterArtifacts ;
33- import org .apache .maven .shared .artifact .filter .collection .GroupIdFilter ;
34- import org .apache .maven .shared .artifact .filter .collection .ScopeFilter ;
35- import org .apache .maven .shared .artifact .filter .collection .TypeFilter ;
36- import org .apache .maven .shared .transfer .artifact .resolve .ArtifactResult ;
37- import org .apache .maven .shared .transfer .dependencies .DependableCoordinate ;
38- import org .apache .maven .shared .transfer .dependencies .resolve .DependencyResolverException ;
3925
4026/**
4127 * @author <a href="mailto:[email protected] ">Brian Fox</a> 4228 */
4329public abstract class AbstractResolveMojo extends AbstractDependencyFilterMojo {
30+
4431 /**
4532 * If specified, this parameter causes the dependencies to be written to the path specified instead of
4633 * the console.
@@ -65,67 +52,4 @@ public abstract class AbstractResolveMojo extends AbstractDependencyFilterMojo {
6552 */
6653 @ Parameter (property = "excludeReactor" , defaultValue = "true" )
6754 protected boolean excludeReactor ;
68-
69- /**
70- * <i>not used in this goal</i>
71- */
72- @ Parameter
73- protected boolean ignorePermissions ;
74-
75- /**
76- * @return {@link FilterArtifacts}
77- */
78- protected FilterArtifacts getArtifactsFilter () {
79- final FilterArtifacts filter = new FilterArtifacts ();
80-
81- if (excludeReactor ) {
82-
83- filter .addFilter (new ExcludeReactorProjectsArtifactFilter (reactorProjects , getLog ()));
84- }
85-
86- filter .addFilter (new ScopeFilter (
87- DependencyUtil .cleanToBeTokenizedString (this .includeScope ),
88- DependencyUtil .cleanToBeTokenizedString (this .excludeScope )));
89-
90- filter .addFilter (new TypeFilter (
91- DependencyUtil .cleanToBeTokenizedString (this .includeTypes ),
92- DependencyUtil .cleanToBeTokenizedString (this .excludeTypes )));
93-
94- filter .addFilter (new ClassifierFilter (
95- DependencyUtil .cleanToBeTokenizedString (this .includeClassifiers ),
96- DependencyUtil .cleanToBeTokenizedString (this .excludeClassifiers )));
97-
98- filter .addFilter (new GroupIdFilter (
99- DependencyUtil .cleanToBeTokenizedString (this .includeGroupIds ),
100- DependencyUtil .cleanToBeTokenizedString (this .excludeGroupIds )));
101-
102- filter .addFilter (new ArtifactIdFilter (
103- DependencyUtil .cleanToBeTokenizedString (this .includeArtifactIds ),
104- DependencyUtil .cleanToBeTokenizedString (this .excludeArtifactIds )));
105-
106- return filter ;
107- }
108-
109- /**
110- * This method resolves all transitive dependencies of an artifact.
111- *
112- * @param artifact the artifact used to retrieve dependencies
113- * @return resolved set of dependencies
114- * @throws DependencyResolverException in case of error while resolving artifacts.
115- */
116- protected Set <Artifact > resolveArtifactDependencies (final DependableCoordinate artifact )
117- throws DependencyResolverException {
118- ProjectBuildingRequest buildingRequest = newResolveArtifactProjectBuildingRequest ();
119-
120- Iterable <ArtifactResult > artifactResults =
121- getDependencyResolver ().resolveDependencies (buildingRequest , artifact , null );
122-
123- Set <Artifact > artifacts = new LinkedHashSet <>();
124-
125- for (final ArtifactResult artifactResult : artifactResults ) {
126- artifacts .add (artifactResult .getArtifact ());
127- }
128-
129- return artifacts ;
130- }
13155}
0 commit comments