Package org.apache.maven.artifact.resolver

Examples of org.apache.maven.artifact.resolver.ResolutionListener


    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here


    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
            case ResolutionListener.TEST_ARTIFACT:
                listener.testArtifact(node.getArtifact());
                break;
            case ResolutionListener.PROCESS_CHILDREN:
                listener.startProcessChildren(node.getArtifact());
                break;
            case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                listener.endProcessChildren(node.getArtifact());
                break;
            case ResolutionListener.INCLUDE_ARTIFACT:
                listener.includeArtifact(node.getArtifact());
                break;
            case ResolutionListener.OMIT_FOR_NEARER:
                String version = node.getArtifact().getVersion();
                String replacementVersion = replacement.getVersion();
                if (version != null ? !version.equals(replacementVersion)
                        : replacementVersion != null) {
                    listener.omitForNearer(node.getArtifact(), replacement);
                }
                break;
            case ResolutionListener.OMIT_FOR_CYCLE:
                listener.omitForCycle(node.getArtifact());
                break;
            case ResolutionListener.UPDATE_SCOPE:
                listener
                        .updateScope(node.getArtifact(), replacement.getScope());
                break;
            case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                listener.updateScopeCurrentPom(node.getArtifact(), replacement
                        .getScope());
                break;
            case ResolutionListener.MANAGE_ARTIFACT:
                listener.manageArtifact(node.getArtifact(), replacement);
                break;
            case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                listener.selectVersionFromRange(node.getArtifact());
                break;
            case ResolutionListener.RESTRICT_RANGE:
                if (node.getArtifact().getVersionRange().hasRestrictions()
                        || replacement.getVersionRange().hasRestrictions()) {
                    listener.restrictRange(node.getArtifact(), replacement,
                            newRange);
                }
                break;
            default:
                throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

        } catch (ProjectBuildingException e) {
            getLog().error(
                    "An error occurred while resolving project dependencies.",
                    e);
        }
        ResolutionListener listener = new ResolutionListenerImpl();
        ((ResolutionListenerImpl)listener).setLog(getLog());
        try {
            collector.collect(project.getDependencyArtifacts(), project
                    .getArtifact(), managedVersions, localRepo, remoteRepos,
                    artifactMetadataSource, null, Collections
View Full Code Here

    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

    private void fireEvent( int event, List listeners, ResolutionNode node, Artifact replacement,
                            VersionRange newRange )
    {
        for ( Iterator i = listeners.iterator(); i.hasNext(); )
        {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch ( event )
            {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact( node.getArtifact() );
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren( node.getArtifact() );
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren( node.getArtifact() );
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact( node.getArtifact() );
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if ( version != null ? !version.equals( replacementVersion ) : replacementVersion != null )
                    {
                        listener.omitForNearer( node.getArtifact(), replacement );
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle( node.getArtifact() );
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener.updateScope( node.getArtifact(), replacement.getScope() );
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom( node.getArtifact(), replacement.getScope() );
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact( node.getArtifact(), replacement );
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange( node.getArtifact() );
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if ( node.getArtifact().getVersionRange().hasRestrictions() ||
                        replacement.getVersionRange().hasRestrictions() )
                    {
                        listener.restrictRange( node.getArtifact(), replacement, newRange );
                    }
                    break;
                default:
                    throw new IllegalStateException( "Unknown event: " + event );
            }
View Full Code Here

    }

    private void fireEvent(int event, List listeners, ResolutionNode node,
            Artifact replacement, VersionRange newRange) {
        for (Iterator i = listeners.iterator(); i.hasNext();) {
            ResolutionListener listener = (ResolutionListener) i.next();

            switch (event) {
                case ResolutionListener.TEST_ARTIFACT:
                    listener.testArtifact(node.getArtifact());
                    break;
                case ResolutionListener.PROCESS_CHILDREN:
                    listener.startProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.FINISH_PROCESSING_CHILDREN:
                    listener.endProcessChildren(node.getArtifact());
                    break;
                case ResolutionListener.INCLUDE_ARTIFACT:
                    listener.includeArtifact(node.getArtifact());
                    break;
                case ResolutionListener.OMIT_FOR_NEARER:
                    String version = node.getArtifact().getVersion();
                    String replacementVersion = replacement.getVersion();
                    if (version != null ? !version.equals(replacementVersion)
                            : replacementVersion != null) {
                        listener.omitForNearer(node.getArtifact(), replacement);
                    }
                    break;
                case ResolutionListener.OMIT_FOR_CYCLE:
                    listener.omitForCycle(node.getArtifact());
                    break;
                case ResolutionListener.UPDATE_SCOPE:
                    listener
                            .updateScope(node.getArtifact(), replacement.getScope());
                    break;
                case ResolutionListener.UPDATE_SCOPE_CURRENT_POM:
                    listener.updateScopeCurrentPom(node.getArtifact(), replacement
                            .getScope());
                    break;
                case ResolutionListener.MANAGE_ARTIFACT:
                    listener.manageArtifact(node.getArtifact(), replacement);
                    break;
                case ResolutionListener.SELECT_VERSION_FROM_RANGE:
                    listener.selectVersionFromRange(node.getArtifact());
                    break;
                case ResolutionListener.RESTRICT_RANGE:
                    if (node.getArtifact().getVersionRange().hasRestrictions()
                            || replacement.getVersionRange().hasRestrictions()) {
                        listener.restrictRange(node.getArtifact(), replacement,
                                newRange);
                    }
                    break;
                default:
                    throw new IllegalStateException("Unknown event: " + event);
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.resolver.ResolutionListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.