Examples of ScopeFilter


Examples of org.apache.maven.shared.artifact.filter.collection.ScopeFilter

    private File outputDirectory;

    @SuppressWarnings("unchecked")
    public void execute() throws MojoExecutionException, MojoFailureException {
        FilterArtifacts filter = new FilterArtifacts();
        filter.addFilter(new ScopeFilter(Artifact.SCOPE_TEST, null));
        filter.addFilter(new TypeFilter("jar", null));
        Set<Artifact> artifacts;
        try {
            artifacts = filter.filter(projectArtifacts);
        }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter

        if (scopes == null || scopes.length == 0) {
            throw new IllegalArgumentException("at least one scope must be specified");
        }
        final Set<ScopeType> allowedScopes = new HashSet<ScopeType>(scopes.length);
        allowedScopes.addAll(Arrays.asList(scopes));
        this.resolutionFilters = new MavenResolutionFilter[] { new ScopeFilter(
                allowedScopes.toArray(new ScopeType[] {})) };
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter

        // Get all declared dependencies
        final List<MavenDependency> dependencies = new ArrayList<MavenDependency>(session.getDeclaredDependencies());

        // Filter by scope
        final MavenResolutionFilter preResolutionFilter = new ScopeFilter(scopes);

        // For all declared dependencies which pass the filter, add 'em to the Set of dependencies to be resolved for
        // this request
        for (final MavenDependency candidate : dependencies) {
            if (preResolutionFilter.accepts(candidate, EMPTY_LIST, EMPTY_LIST)) {
                session.getDependenciesForResolution().add(candidate);
            }
        }
        return session;
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter

    public static JavaArchive createDeployment() {
/*
        File[] files = DependencyResolvers.use(MavenDependencyResolver.class).artifact("org.knowhowlab.osgi:org.knowhowlab.osgi.testing.it.test.bundle:1.0.1-SNAPSHOT").resolveAsFiles(new ScopeFilter());
        return ShrinkWrap.createFromZipFile(JavaArchive.class, files[0]);
*/
        File[] files = DependencyResolvers.use(MavenDependencyResolver.class).artifact("org.knowhowlab.osgi:org.knowhowlab.osgi.testing.it.test.bundle:1.0.1-SNAPSHOT").resolveAsFiles(new ScopeFilter());
        return ShrinkWrap.create(ZipImporter.class).importFrom(files[0]).as(JavaArchive.class);
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter

        if (!CACHE.containsKey(pom)) {
            try { // try offline first since it is generally faster
                CACHE.put(pom, DependencyResolvers.use(MavenDependencyResolver.class)
                        .goOffline()
                        .loadEffectivePom(pom)
                        .importAnyDependencies(new ScopeFilter("compile"))
                        .resolveAsFiles());
            } catch (ResolutionException re) { // try on central
                CACHE.put(pom, DependencyResolvers.use(MavenDependencyResolver.class)
                        .loadEffectivePom(pom)
                        .importAnyDependencies(new ScopeFilter("compile"))
                        .resolveAsFiles());
            }
        }
        return CACHE.get(pom);
    }
View Full Code Here

Examples of org.jboss.shrinkwrap.resolver.api.maven.filter.ScopeFilter

        File[] hibernate;
        try { // try offline first since it is generally faster
            hibernate = DependencyResolvers.use(MavenDependencyResolver.class)
                .goOffline()
                .loadEffectivePom("src/test/resources/hibernate-pom.xml")
                .importAnyDependencies(new ScopeFilter("compile"))
                .resolveAsFiles();
        } catch (ResolutionException re) { // try on central
            hibernate = DependencyResolvers.use(MavenDependencyResolver.class)
                    .loadEffectivePom("src/test/resources/hibernate-pom.xml")
                    .importAnyDependencies(new ScopeFilter("compile"))
                    .resolveAsFiles();
        }

        return ShrinkWrap.create(WebArchive.class, "hibernate-app.war")
                    .addAsWebInfResource(new StringAsset("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.