code: private Set<Artifact> getDependencies(final Set<Artifact> projectDependencies) {
          Set<Artifact> result = new LinkedHashSet<Artifact>(projectDependencies);
          Set<Artifact> testDependencies = dependenciesWithScope(projectDependencies, Artifact.SCOPE_TEST);
          Set<Artifact> nonTestDependencies = allBut(projectDependencies, testDependencies);
  
          Set<Artifact> testTransitives = resolve(testDependencies);
          Set<Artifact> nonTestTransitives = resolve(nonTestDependencies);
  
          Set<Artifact> testOnlyDependencies = allBut(testTransitives, nonTestTransitives);
  
          for (Artifact testOnly : testOnlyDependencies) {
              result.add(new DefaultArtifact(testOnly.getGroupId(), testOnly.getArtifactId(), testOnly.getVersion(), Artifact.SCOPE_TEST, testOnly.getType(), testOnly.getClassifier(), testOnly
                      .getArtifactHandler()));
          }
  
          result.addAll(resolve(projectDependencies));
          return result;
      }
docs: Collects dependencies, including transitives.
  Project dependencies retain their scope, while test only dependencies (including transitives) will have test scope.
  @param projectDependencies
  @return