org.apache.maven.ProjectDependenciesResolver Java Examples

The following examples show how to use org.apache.maven.ProjectDependenciesResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DependenciesResolver.java    From dew with Apache License 2.0 5 votes vote down vote up
/**
 * Init.
 *
 * @param mavenSession the maven session
 */
public static void init(MavenSession mavenSession) {
    if (ExecuteOnceProcessor.executedCheck(DependenciesResolver.class)) {
        return;
    }
    try {
        DefaultProjectDependenciesResolver resolver = (DefaultProjectDependenciesResolver) mavenSession.getContainer()
                .lookup(ProjectDependenciesResolver.class.getName());
        for (MavenProject mavenProject : mavenSession.getProjectDependencyGraph().getSortedProjects()) {
            mavenProject.setArtifacts(resolve(resolver, mavenProject, mavenSession));
        }
    } catch (ComponentLookupException e) {
        throw new GlobalProcessException(e.getMessage(), e);
    }
}