Package org.jboss.shrinkwrap.resolver.api.maven.strategy

Examples of org.jboss.shrinkwrap.resolver.api.maven.strategy.TransitiveExclusionPolicy


                .loadPomFromFile("target/poms/test-dependency.xml").addDependencies(dependency).resolve()
                .using(new MavenResolutionStrategy() {

                    @Override
                    public TransitiveExclusionPolicy getTransitiveExclusionPolicy() {
                        return new TransitiveExclusionPolicy() {

                            @Override
                            public ScopeType[] getFilteredScopes() {
                                return new ScopeType[] { ScopeType.PROVIDED, ScopeType.TEST };
                            }
View Full Code Here


        Collection<ArtifactResult> results = Collections.emptyList();

        // Set the dependency selector used in resolving transitive dependencies based on our transitive exclusion
        // policy abstraction
        final Set<DependencySelector> dependencySelectors = new HashSet<DependencySelector>(3);
        final TransitiveExclusionPolicy transitiveExclusionPolicy = strategy.getTransitiveExclusionPolicy();
        final ScopeType[] filteredScopes = transitiveExclusionPolicy.getFilteredScopes();
        final int numFilteredScopes = filteredScopes.length;
        final String[] filteredScopeStrings = new String[numFilteredScopes];
        for (int i = 0; i < numFilteredScopes; i++) {
            filteredScopeStrings[i] = filteredScopes[i].toString();
        }
        if (numFilteredScopes > 0) {
            dependencySelectors.add(new ScopeDependencySelector(filteredScopeStrings));
        }
        if (!transitiveExclusionPolicy.allowOptional()) {
            dependencySelectors.add(new OptionalDependencySelector());
        }
        dependencySelectors.add(new ExclusionDependencySelector());
        final DependencySelector dependencySelector = new AndDependencySelector(dependencySelectors);
        session.setDependencySelector(dependencySelector);
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.resolver.api.maven.strategy.TransitiveExclusionPolicy

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.