Example usage for org.apache.maven.project MavenProject getDependencyArtifacts

List of usage examples for org.apache.maven.project MavenProject getDependencyArtifacts

Introduction

In this page you can find the example usage for org.apache.maven.project MavenProject getDependencyArtifacts.

Prototype

@Deprecated
public Set<Artifact> getDependencyArtifacts() 

Source Link

Document

Direct dependencies that this project has.

Usage

From source file:org.codehaus.mojo.license.api.DefaultDependenciesTool.java

License:Open Source License

/**
 * {@inheritDoc}//from  ww w .j  av a  2s  .  c  om
 */
public SortedMap<String, MavenProject> loadProjectDependencies(MavenProject project,
        MavenProjectDependenciesConfigurator configuration, ArtifactRepository localRepository,
        List<ArtifactRepository> remoteRepositories, SortedMap<String, MavenProject> cache) {

    boolean haveNoIncludedGroups = StringUtils.isEmpty(configuration.getIncludedGroups());
    boolean haveNoIncludedArtifacts = StringUtils.isEmpty(configuration.getIncludedArtifacts());

    boolean haveExcludedGroups = StringUtils.isNotEmpty(configuration.getExcludedGroups());
    boolean haveExcludedArtifacts = StringUtils.isNotEmpty(configuration.getExcludedArtifacts());
    boolean haveExclusions = haveExcludedGroups || haveExcludedArtifacts;

    Pattern includedGroupPattern = null;
    Pattern includedArtifactPattern = null;
    Pattern excludedGroupPattern = null;
    Pattern excludedArtifactPattern = null;

    if (!haveNoIncludedGroups) {
        includedGroupPattern = Pattern.compile(configuration.getIncludedGroups());
    }
    if (!haveNoIncludedArtifacts) {
        includedArtifactPattern = Pattern.compile(configuration.getIncludedArtifacts());
    }
    if (haveExcludedGroups) {
        excludedGroupPattern = Pattern.compile(configuration.getExcludedGroups());
    }
    if (haveExcludedArtifacts) {
        excludedArtifactPattern = Pattern.compile(configuration.getExcludedArtifacts());
    }

    Set<?> depArtifacts;

    if (configuration.isIncludeTransitiveDependencies()) {
        // All project dependencies
        depArtifacts = project.getArtifacts();
    } else {
        // Only direct project dependencies
        depArtifacts = project.getDependencyArtifacts();
    }

    List<String> includedScopes = configuration.getIncludedScopes();
    List<String> excludeScopes = configuration.getExcludedScopes();

    boolean verbose = configuration.isVerbose();

    SortedMap<String, MavenProject> result = new TreeMap<String, MavenProject>();

    for (Object o : depArtifacts) {
        Artifact artifact = (Artifact) o;

        if (DefaultThirdPartyTool.LICENSE_DB_TYPE.equals(artifact.getType())) {
            // the special dependencies for license databases don't count.
            // Note that this will still see transitive deps of a license db; so using the build helper inside of another project
            // to make them will be noisy.
            continue;
        }

        String scope = artifact.getScope();
        if (CollectionUtils.isNotEmpty(includedScopes) && !includedScopes.contains(scope)) {

            // not in included scopes
            continue;
        }

        if (excludeScopes.contains(scope)) {

            // in excluded scopes
            continue;
        }

        Logger log = getLogger();

        String id = MojoHelper.getArtifactId(artifact);

        if (verbose) {
            log.info("detected artifact " + id);
        }

        // Check if the project should be included
        // If there is no specified artifacts and group to include, include all
        boolean isToInclude = haveNoIncludedArtifacts && haveNoIncludedGroups
                || isIncludable(artifact, includedGroupPattern, includedArtifactPattern);

        // Check if the project should be excluded
        boolean isToExclude = isToInclude && haveExclusions
                && isExcludable(artifact, excludedGroupPattern, excludedArtifactPattern);

        if (!isToInclude || isToExclude) {
            if (verbose) {
                log.info("skip artifact " + id);
            }
            continue;
        }

        MavenProject depMavenProject = null;

        if (cache != null) {

            // try to get project from cache
            depMavenProject = cache.get(id);
        }

        if (depMavenProject != null) {
            if (verbose) {
                log.info("add dependency [" + id + "] (from cache)");
            }
        } else {
            // build project

            try {
                depMavenProject = mavenProjectBuilder.buildFromRepository(artifact, remoteRepositories,
                        localRepository, true);
                depMavenProject.getArtifact().setScope(artifact.getScope());
            } catch (ProjectBuildingException e) {
                log.warn("Unable to obtain POM for artifact : " + artifact, e);
                continue;
            }

            if (verbose) {
                log.info("add dependency [" + id + "]");
            }
            if (cache != null) {

                // store it also in cache
                cache.put(id, depMavenProject);
            }
        }

        // keep the project
        result.put(id, depMavenProject);
    }
    return result;
}

From source file:org.codehaus.mojo.license.api.DefaultDependenciesTool.java

License:Open Source License

/**
 * {@inheritDoc}/*from  ww  w.  j a v  a2 s  . c o  m*/
 */
public void loadProjectArtifacts(ArtifactRepository localRepository, List remoteRepositories,
        MavenProject project) throws DependenciesToolException

{

    if (CollectionUtils.isEmpty(project.getDependencyArtifacts())) {

        Set dependenciesArtifacts;
        try {
            dependenciesArtifacts = MavenMetadataSource.createArtifacts(artifactFactory,
                    project.getDependencies(), null, null, project);
        } catch (InvalidDependencyVersionException e) {
            throw new DependenciesToolException(e);
        }
        project.setDependencyArtifacts(dependenciesArtifacts);

        Artifact artifact = project.getArtifact();

        ArtifactResolutionResult result;
        try {
            result = artifactResolver.resolveTransitively(dependenciesArtifacts, artifact, remoteRepositories,
                    localRepository, artifactMetadataSource);
        } catch (ArtifactResolutionException e) {
            throw new DependenciesToolException(e);
        } catch (ArtifactNotFoundException e) {
            throw new DependenciesToolException(e);
        }

        project.setArtifacts(result.getArtifacts());

    }

}

From source file:org.codehaus.mojo.license.ArtifactHelper.java

License:Open Source License

/**
 * Get the list of project dependencies after applying transitivity and filtering rules.
 * /*w  ww . j av  a 2s  . c o m*/
 * @param mojo
 * @param log
 * @param cache
 * @return
 */
public static SortedMap<String, MavenProject> loadProjectDependencies(MavenProjectDependenciesLoader mojo,
        Log log, SortedMap<String, MavenProject> cache) {

    boolean haveNoIncludedGroups = StringUtils.isEmpty(mojo.getIncludedGroups());
    boolean haveNoIncludedArtifacts = StringUtils.isEmpty(mojo.getIncludedArtifacts());

    boolean haveExcludedGroups = StringUtils.isNotEmpty(mojo.getExcludedGroups());
    boolean haveExcludedArtifacts = StringUtils.isNotEmpty(mojo.getExcludedArtifacts());
    boolean haveExclusions = haveExcludedGroups || haveExcludedArtifacts;

    Pattern includedGroupPattern = null;
    Pattern includedArtifactPattern = null;
    Pattern excludedGroupPattern = null;
    Pattern excludedArtifactPattern = null;

    if (!haveNoIncludedGroups) {
        includedGroupPattern = Pattern.compile(mojo.getIncludedGroups());
    }
    if (!haveNoIncludedArtifacts) {
        includedArtifactPattern = Pattern.compile(mojo.getIncludedArtifacts());
    }
    if (haveExcludedGroups) {
        excludedGroupPattern = Pattern.compile(mojo.getExcludedGroups());
    }
    if (haveExcludedArtifacts) {
        excludedArtifactPattern = Pattern.compile(mojo.getExcludedArtifacts());
    }

    MavenProject project = mojo.getProject();

    Set<?> depArtifacts;

    if (mojo.isIncludeTransitiveDependencies()) {
        // All project dependencies
        depArtifacts = project.getArtifacts();
    } else {
        // Only direct project dependencies
        depArtifacts = project.getDependencyArtifacts();
    }

    ArtifactRepository localRepository = mojo.getLocalRepository();
    List remoteRepositories = mojo.getRemoteRepositories();
    MavenProjectBuilder projectBuilder = mojo.getMavenProjectBuilder();

    List<String> excludeScopes = mojo.getExcludeScopes();

    boolean verbose = mojo.isVerbose();

    SortedMap<String, MavenProject> result = new TreeMap<String, MavenProject>();

    for (Object o : depArtifacts) {
        Artifact artifact = (Artifact) o;

        if (excludeScopes.contains(artifact.getScope())) {

            // never treate system artifacts (they are mysterious and
            // no information can be retrive from anywhere)...
            continue;
        }

        String id = getArtifactId(artifact);

        if (verbose) {
            log.info("detected artifact " + id);
        }

        // Check if the project should be included
        // If there is no specified artifacts and group to include, include all
        boolean isToInclude = haveNoIncludedArtifacts && haveNoIncludedGroups
                || isIncludable(log, artifact, includedGroupPattern, includedArtifactPattern);

        // Check if the project should be excluded
        boolean isToExclude = isToInclude && haveExclusions
                && isExcludable(log, artifact, excludedGroupPattern, excludedArtifactPattern);

        if (!isToInclude || isToExclude) {
            if (verbose) {
                log.info("skip artifact " + id);
            }
            continue;
        }

        MavenProject depMavenProject = null;

        if (cache != null) {

            // try to get project from cache
            depMavenProject = cache.get(id);
        }

        if (depMavenProject != null) {
            if (verbose) {
                log.info("add dependency [" + id + "] (from cache)");
            }
        } else {

            // build project

            try {
                depMavenProject = projectBuilder.buildFromRepository(artifact, remoteRepositories,
                        localRepository, true);
            } catch (ProjectBuildingException e) {
                log.warn("Unable to obtain POM for artifact : " + artifact);
                log.warn(e);
                continue;
            }

            if (verbose) {
                log.info("add dependency [" + id + "]");
            }
            if (cache != null) {

                // store it also in cache
                cache.put(id, depMavenProject);
            }
        }

        // keep the project
        result.put(id, depMavenProject);
    }

    return result;
}

From source file:org.codehaus.mojo.license.DefaultDependenciesTool.java

License:Educational Community License

/**
 * {@inheritDoc}//  ww  w  .j a  v a  2s .c om
 */
@Override
public SortedMap<String, MavenProject> loadProjectDependencies(MavenProject project,
        MavenProjectDependenciesConfigurator configuration, ArtifactRepository localRepository,
        List<ArtifactRepository> remoteRepositories, SortedMap<String, MavenProject> cache) {

    boolean haveNoIncludedGroups = StringUtils.isEmpty(configuration.getIncludedGroups());
    boolean haveNoIncludedArtifacts = StringUtils.isEmpty(configuration.getIncludedArtifacts());

    boolean haveExcludedGroups = StringUtils.isNotEmpty(configuration.getExcludedGroups());
    boolean haveExcludedArtifacts = StringUtils.isNotEmpty(configuration.getExcludedArtifacts());
    boolean haveExclusions = haveExcludedGroups || haveExcludedArtifacts;

    Pattern includedGroupPattern = null;
    Pattern includedArtifactPattern = null;
    Pattern excludedGroupPattern = null;
    Pattern excludedArtifactPattern = null;

    if (!haveNoIncludedGroups) {
        includedGroupPattern = Pattern.compile(configuration.getIncludedGroups());
    }
    if (!haveNoIncludedArtifacts) {
        includedArtifactPattern = Pattern.compile(configuration.getIncludedArtifacts());
    }
    if (haveExcludedGroups) {
        excludedGroupPattern = Pattern.compile(configuration.getExcludedGroups());
    }
    if (haveExcludedArtifacts) {
        excludedArtifactPattern = Pattern.compile(configuration.getExcludedArtifacts());
    }

    Set<?> depArtifacts;

    if (configuration.isIncludeTransitiveDependencies()) {
        // All project dependencies
        depArtifacts = project.getArtifacts();
    } else {
        // Only direct project dependencies
        depArtifacts = project.getDependencyArtifacts();
    }

    List<String> includedScopes = configuration.getIncludedScopes();
    List<String> excludeScopes = configuration.getExcludedScopes();

    boolean verbose = configuration.isVerbose();

    SortedMap<String, MavenProject> result = new TreeMap<String, MavenProject>();

    for (Object o : depArtifacts) {
        Artifact artifact = (Artifact) o;

        String scope = artifact.getScope();
        if (CollectionUtils.isNotEmpty(includedScopes) && !includedScopes.contains(scope)) {
            // not in included scopes
            continue;
        }
        if (excludeScopes.contains(scope)) {
            // in excluded scopes
            continue;
        }

        Logger log = getLogger();

        String id = MojoHelper.getArtifactId(artifact);

        if (verbose) {
            log.info("detected artifact " + id);
        }

        // Check if the project should be included
        // If there is no specified artifacts and group to include, include all
        boolean isToInclude = haveNoIncludedArtifacts && haveNoIncludedGroups
                || isIncludable(artifact, includedGroupPattern, includedArtifactPattern);

        // Check if the project should be excluded
        boolean isToExclude = isToInclude && haveExclusions
                && isExcludable(artifact, excludedGroupPattern, excludedArtifactPattern);

        if (!isToInclude || isToExclude) {
            if (verbose) {
                log.info("skip artifact " + id);
            }
            continue;
        }

        MavenProject depMavenProject = null;

        if (cache != null) {

            // try to get project from cache
            depMavenProject = cache.get(id);
        }

        if (depMavenProject != null) {
            if (verbose) {
                log.info("add dependency [" + id + "] (from cache)");
            }
        } else {
            // build project
            try {
                depMavenProject = mavenProjectBuilder.buildFromRepository(artifact, remoteRepositories,
                        localRepository, true);
            } catch (Exception e) {
                log.warn("Unable to obtain POM for artifact : " + artifact, e);
                continue;
            }

            if (verbose) {
                log.info("add dependency [" + id + "]");
            }
            if (cache != null) {
                // store it also in cache
                cache.put(id, depMavenProject);
            }
        }

        // keep the project
        result.put(id, depMavenProject);
    }

    return result;
}

From source file:org.codehaus.mojo.pluginsupport.dependency.DependencyHelper.java

License:Apache License

public DependencyTree getDependencies(final MavenProject project)
        throws ProjectBuildingException, InvalidDependencyVersionException, ArtifactResolutionException {
    assert project != null;

    Map managedVersions = getManagedVersionMap(project, artifactFactory);
    DependencyResolutionListener listener = new DependencyResolutionListener();

    if (project.getDependencyArtifacts() == null) {
        project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null, null));
    }//w  w  w  . ja va2  s .c om

    artifactCollector.collect(project.getDependencyArtifacts(), project.getArtifact(), managedVersions,
            getArtifactRepository(), project.getRemoteArtifactRepositories(), artifactMetadataSource, null,
            Collections.singletonList(listener));

    return listener.getDependencyTree();
}

From source file:org.codehaus.mojo.pomtools.helpers.MetadataHelper.java

License:Apache License

/** Resolves all transitive dependencies for the current project and returns a list
 * of {@link TransitiveDependencyInfo} objects.  Each object represents a distinct 
 * groupId:artifactId:type dependency.  The {@link TransitiveDependencyInfo#getResolutionNodes()}
 * represent all of the possible ResolutionNodes which resolve to this groupId:artifactId.
 * /*  w w w.  ja  v  a  2 s .c  o m*/
 * @return
 * @throws PomToolsException
 */
public List getTransitiveDependencies() throws PomToolsException, ProjectBuildingException {
    // Certain things like groupId or versions for dependencies may be declared in a parent
    // pom so we need to have maven fully resolve the model before walking the tree.
    MavenProject project = PomToolsPluginContext.getInstance().getActiveProject().getTemporaryResolvedProject();

    try {
        project.setDependencyArtifacts(project.createArtifacts(artifactFactory, null, null));
    } catch (InvalidDependencyVersionException e) {
        throw new PomToolsVersionException(
                "Unable to build project due to an invalid dependency version: " + e.getMessage(), e);
    }

    Artifact projectArtifact = project.getArtifact();

    Set artifacts = project.getDependencyArtifacts();

    try {
        List dependencies = new ArrayList();

        ArtifactResolutionResult result;
        result = artifactResolver.resolveTransitively(artifacts, projectArtifact, Collections.EMPTY_MAP,
                localRepository, remoteRepositories, metadataSource, projectArtifact.getDependencyFilter());

        Map dependencyMap = new HashMap();
        Set seen = new HashSet();

        // First build our map of distinct groupId:artifactIds
        for (Iterator iter = result.getArtifactResolutionNodes().iterator(); iter.hasNext();) {
            ResolutionNode node = (ResolutionNode) iter.next();

            TransitiveDependencyInfo info = new TransitiveDependencyInfo(node);

            dependencyMap.put(info.getKey(), info);

            dependencies.add(info);
        }

        // Now populate the map with all children
        recurseNode(dependencyMap, seen, result.getArtifactResolutionNodes().iterator(), 0);

        return dependencies;
    } catch (ArtifactNotFoundException e) {
        throw new PomToolsException(e);
    } catch (ArtifactResolutionException e) {
        throw new PomToolsException(e);
    }

}

From source file:org.commonjava.emb.project.graph.DependencyGraphResolver.java

License:Apache License

private DependencyGraph accumulate(final ProjectToolsSession session, final RepositorySystemSession rss,
        final Collection<MavenProject> projects, final RemoteRepository... remoteRepositories) {
    final ArtifactTypeRegistry stereotypes = rss.getArtifactTypeRegistry();

    final DependencyGraph depGraph = session.getDependencyGraph();
    final GraphAccumulator accumulator = new GraphAccumulator(depGraph);

    for (final MavenProject project : projects) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Collecting dependencies for: " + project);
        }/*from  w  w w .j  ava  2s  .co  m*/
        final CollectRequest request = new CollectRequest();
        request.setRequestContext("project");
        request.setRepositories(Arrays.asList(remoteRepositories));

        if (project.getDependencyArtifacts() == null) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Adding dependencies to collection request...");
            }
            for (final Dependency dependency : project.getDependencies()) {
                request.addDependency(RepositoryUtils.toDependency(dependency, stereotypes));
            }
        } else {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Mapping project dependencies by management key...");
            }
            final Map<String, Dependency> dependencies = new HashMap<String, Dependency>();
            for (final Dependency dependency : project.getDependencies()) {
                final String key = dependency.getManagementKey();
                dependencies.put(key, dependency);
            }

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Adding dependencies to collection request...");
            }
            for (final org.apache.maven.artifact.Artifact artifact : project.getDependencyArtifacts()) {
                final String key = artifact.getDependencyConflictId();
                final Dependency dependency = dependencies.get(key);
                final Collection<org.apache.maven.model.Exclusion> exclusions = dependency != null
                        ? dependency.getExclusions()
                        : null;

                org.sonatype.aether.graph.Dependency dep = RepositoryUtils.toDependency(artifact, exclusions);
                if (!JavaScopes.SYSTEM.equals(dep.getScope()) && dep.getArtifact().getFile() != null) {
                    // enable re-resolution
                    org.sonatype.aether.artifact.Artifact art = dep.getArtifact();
                    art = art.setFile(null).setVersion(art.getBaseVersion());
                    dep = dep.setArtifact(art);
                }
                request.addDependency(dep);
            }
        }

        final DependencyManagement depMngt = project.getDependencyManagement();
        if (depMngt != null) {
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Adding managed dependencies to collection request...");
            }
            for (final Dependency dependency : depMngt.getDependencies()) {
                request.addManagedDependency(RepositoryUtils.toDependency(dependency, stereotypes));
            }
        }

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Collecting dependencies...");
        }
        CollectResult result;
        try {
            result = repositorySystem.collectDependencies(rss, request);
        } catch (final DependencyCollectionException e) {
            // TODO: Handle problem resolving POMs...
            result = e.getResult();

            // result.setDependencyGraph( e.getResult().getRoot() );
            // result.setCollectionErrors( e.getResult().getExceptions() );
            //
            // throw new DependencyResolutionException( result, "Could not resolve dependencies for project "
            // + project.getId() + ": " + e.getMessage(), e );
        }

        final DependencyNode root = result.getRoot();
        final DepGraphRootNode rootNode = depGraph.addRoot(root, project);

        accumulator.resetForNextRun(root, rootNode);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Adding collected dependencies to consolidated dependency graph...");
        }
        result.getRoot().accept(accumulator);

    }

    return depGraph;
}

From source file:org.eclipse.che.maven.server.MavenServerImpl.java

License:Open Source License

private MavenResult internalResolveProject(File pom, List<String> activeProfiles, List<String> inactiveProfiles,
        List<ResolutionListener> dependencyTreeResolutionListeners) {

    MavenExecutionRequest request = newMavenRequest(pom, activeProfiles, inactiveProfiles,
            Collections.emptyList());
    request.setUpdateSnapshots(updateSnapshots);

    AtomicReference<MavenResult> reference = new AtomicReference<>();
    runMavenRequest(request, () -> {//  w w w  .  j ava 2s.co m
        try {
            ProjectBuilder builder = getMavenComponent(ProjectBuilder.class);

            List<ProjectBuildingResult> resultList = builder.build(Collections.singletonList(pom), false,
                    request.getProjectBuildingRequest());
            ProjectBuildingResult result = resultList.get(0);
            MavenProject mavenProject = result.getProject();
            RepositorySystemSession repositorySession = getMavenComponent(LegacySupport.class)
                    .getRepositorySession();
            if (repositorySession instanceof DefaultRepositorySystemSession) {
                ((DefaultRepositorySystemSession) repositorySession)
                        .setTransferListener(new ArtifactTransferListener(mavenProgressNotifier));
                if (workspaceCache != null) {
                    ((DefaultRepositorySystemSession) repositorySession)
                            .setWorkspaceReader(new MavenWorkspaceReader(workspaceCache));
                }

            }

            List<Exception> exceptions = new ArrayList<>();

            loadExtensions(mavenProject, exceptions);
            mavenProject.setDependencyArtifacts(
                    mavenProject.createArtifacts(getMavenComponent(ArtifactFactory.class), null, null));

            ArtifactResolutionRequest resolutionRequest = new ArtifactResolutionRequest();
            resolutionRequest.setArtifact(mavenProject.getArtifact());
            resolutionRequest.setRemoteRepositories(mavenProject.getRemoteArtifactRepositories());
            resolutionRequest.setArtifactDependencies(mavenProject.getDependencyArtifacts());
            resolutionRequest.setListeners(dependencyTreeResolutionListeners);
            resolutionRequest.setLocalRepository(localRepo);
            resolutionRequest.setManagedVersionMap(mavenProject.getManagedVersionMap());
            resolutionRequest.setResolveTransitively(true);
            resolutionRequest.setResolveRoot(false);
            ArtifactResolver resolver = getMavenComponent(ArtifactResolver.class);
            ArtifactResolutionResult resolve = resolver.resolve(resolutionRequest);
            mavenProject.setArtifacts(resolve.getArtifacts());
            reference.set(new MavenResult(mavenProject, exceptions));

        } catch (Exception e) {
            reference.set(new MavenResult(null, null, Collections.singletonList(e)));
        }
    });
    return reference.get();
}

From source file:org.eclipse.ebr.maven.DependencyUtil.java

License:Open Source License

public Set<Artifact> getDependenciesToInclude(final MavenProject project) {
    getLog().debug("Computing direct dependencies to include");

    // start with direct dependencies
    final Set<Artifact> dependencies = new LinkedHashSet<Artifact>(project.getDependencyArtifacts());

    // prepare set of artifact ids to exclude
    final Set<String> excludedArtifactIds = checkNotNull(this.excludedArtifactIds,
            "programming error: list of dependencies not initialized");

    // remove all dependencies which should not be in the list
    for (final Iterator<Artifact> stream = dependencies.iterator(); stream.hasNext();) {
        final Artifact artifact = stream.next();
        if (!isAllowedDependency(artifact, excludedArtifactIds)) {
            stream.remove();//from www .  j a va2s  .c  om
        }
    }
    return dependencies;
}

From source file:org.evosuite.maven.util.ProjectUtils.java

License:Open Source License

/**
 * Get project's dependencies/*from  w  w w .j a v a 2s .c o  m*/
 * 
 * @param project
 * @return
 */
public static List<String> getDependencyPathElements(MavenProject project) {
    List<String> dependencyArtifacts = new ArrayList<String>();

    project.getDependencyArtifacts().stream().filter(element -> !element.isOptional())
            // FIXME do we really need to check the 'scope'?
            //.filter(element -> element.getScope().equals(scope))
            .filter(element -> element.getFile().exists())
            .filter(element -> !element.getGroupId().equals(PackageInfo.getEvoSuitePackage()))
            .filter(element -> !element.getGroupId().equals("junit"))
            .forEach(element -> dependencyArtifacts.add(element.getFile().getAbsolutePath()));

    return dependencyArtifacts;
}