示例#1
0
 /**
  * Find unused artifacts.
  *
  * @param env Environment
  * @return Collection of unused artifacts
  */
 private static Collection<String> used(final MavenEnvironment env) {
   final ProjectDependencyAnalysis analysis = DependenciesValidator.analyze(env);
   final Collection<String> used = new LinkedList<String>();
   for (final Object artifact : analysis.getUsedUndeclaredArtifacts()) {
     used.add(artifact.toString());
   }
   return used;
 }
示例#2
0
 /**
  * Find unused artifacts.
  *
  * @param env Environment
  * @return Collection of unused artifacts
  */
 private static Collection<String> unused(final MavenEnvironment env) {
   final ProjectDependencyAnalysis analysis = DependenciesValidator.analyze(env);
   final Collection<String> unused = new LinkedList<String>();
   for (final Object obj : analysis.getUnusedDeclaredArtifacts()) {
     final Artifact artifact = (Artifact) obj;
     if (!artifact.getScope().equals(Artifact.SCOPE_COMPILE)) {
       continue;
     }
     unused.add(artifact.toString());
   }
   return unused;
 }