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

Examples of org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependency


     */
    public void addDependency(final String artifactName, final String artifactVersion, final String... exclusions) {

        final MavenDependencyExclusion[] depExclusions = getMavenDependencyExclusions(exclusions);
        final String canonicalForm = String.format("%s:%s", artifactName, artifactVersion);
        final MavenDependency dep = MavenDependencies
                .createDependency(canonicalForm, ScopeType.COMPILE, false, depExclusions);
        mavenDependencyResolver.addDependency(dep);
    }
View Full Code Here


     * Tests limiting of the scope and strict artifacts
     */
    @Test
    public void combinedScopeNonTransitiveFilter() {

        final MavenDependency dependency = MavenDependencies.createDependency(
            "org.jboss.shrinkwrap.test:test-dependency-test:1.0.0", ScopeType.TEST, false);
        File[] files = Maven
            .resolver()
            .loadPomFromFile("target/poms/test-parent.xml")
            .addDependency(dependency)
View Full Code Here

     * Tests limiting of the scope and strict artifacts. Uses artifacts() method
     */
    @Test
    public void combinedScopeNonTransitiveFilter2() {

        final MavenDependency dependency = MavenDependencies.createDependency(
                "org.jboss.shrinkwrap.test:test-dependency-test:1.0.0", ScopeType.TEST, false);
        final MavenDependency dependency2 = MavenDependencies.createDependency(
                "org.jboss.shrinkwrap.test:test-dependency:1.0.0", ScopeType.TEST, false);
        File[] files = Maven.resolver().loadPomFromFile("target/poms/test-parent.xml").addDependency(dependency)
                .addDependency(dependency2).resolve()
                .using(new CombinedStrategy(NonTransitiveStrategy.INSTANCE, new AcceptScopesStrategy(ScopeType.TEST)))
                .as(File.class);
View Full Code Here

     *
     */
    @Test
    public void combinedScopeNonTransitiveFilter3() {

        final MavenDependency dependency = MavenDependencies.createDependency(
                "org.jboss.shrinkwrap.test:test-dependency-test:1.0.0", ScopeType.TEST, false);
        final MavenDependency dependency2 = MavenDependencies.createDependency(
                "org.jboss.shrinkwrap.test:test-dependency:1.0.0", ScopeType.PROVIDED, false);
        File file = Maven.resolver().loadPomFromFile("target/poms/test-parent.xml")
                .addDependencies(dependency, dependency2).resolve()
                .using(new CombinedStrategy(NonTransitiveStrategy.INSTANCE, new AcceptScopesStrategy(ScopeType.PROVIDED)))
                .asSingle(File.class);
View Full Code Here

    public void asMavenResolvedArtifact() {
        // given
        final String artifactCanonicalFormA = "org.jboss.shrinkwrap.test:test-deps-a:jar:1.0.0";
        final String artifactCanonicalFormB = "org.jboss.shrinkwrap.test:test-deps-b:jar:1.0.0";

        final MavenDependency dependencyA = MavenDependencies.createDependency(artifactCanonicalFormA, ScopeType.TEST,
                false);
        final MavenDependency dependencyB = MavenDependencies.createDependency(artifactCanonicalFormB, ScopeType.TEST,
                false);

        final MavenCoordinate originalCoordinateA = MavenCoordinates.createCoordinate(artifactCanonicalFormA);
        final MavenCoordinate originalCoordinateB = MavenCoordinates.createCoordinate(artifactCanonicalFormB);
View Full Code Here

    @Test
    public void emptyResolvedListFromPom() {
        // given
        final String artifactCanonicalForm = "org.jboss.shrinkwrap.test:test-parent:pom:1.0.0";

        final MavenDependency dependency = MavenDependencies.createDependency(artifactCanonicalForm, ScopeType.TEST,
                false);

        // when
        final MavenResolvedArtifact[] resolvedArtifactInfos = Maven.resolver()
                .loadPomFromFile("target/poms/test-parent.xml").addDependencies(dependency).resolve().withoutTransitivity()
View Full Code Here

        final String child2CanonicalForm = "org.jboss.shrinkwrap.test:test-deps-b:jar:1.0.0";
        final MavenCoordinate originalCoordinate = MavenCoordinates.createCoordinate(artifactCanonicalForm);
        final MavenCoordinate child1Coordinate = MavenCoordinates.createCoordinate(child1CanonicalForm);
        final MavenCoordinate child2Coordinate = MavenCoordinates.createCoordinate(child2CanonicalForm);

        final MavenDependency dependency = MavenDependencies.createDependency(artifactCanonicalForm, ScopeType.TEST,
                false);

        // when
        final MavenResolvedArtifact[] resolvedArtifactInfos = Maven.resolver()
                .loadPomFromFile("target/poms/test-dependency.xml").addDependencies(dependency).resolve()
View Full Code Here

        final String artifactCanonicalForm = "org.jboss.shrinkwrap.test:test-deps-optional:jar:1.0.0";
        final String child1CanonicalForm = "org.jboss.shrinkwrap.test:test-managed-dependency:jar:1.0.0";
        final MavenCoordinate originalCoordinate = MavenCoordinates.createCoordinate(artifactCanonicalForm);
        final MavenCoordinate child1Coordinate = MavenCoordinates.createCoordinate(child1CanonicalForm);

        final MavenDependency dependency = MavenDependencies.createDependency(artifactCanonicalForm, ScopeType.COMPILE,
                false);

        // when
        final MavenResolvedArtifact[] resolvedArtifactInfos = Maven.resolver()
                .loadPomFromFile("target/poms/test-dependency.xml").addDependencies(dependency).resolve()
View Full Code Here

    @Test
    public void exclusion() {

        final MavenDependencyExclusion exclusion = MavenDependencies
            .createExclusion("org.jboss.shrinkwrap.test:test-deps-f");
        final MavenDependency dependency = MavenDependencies.createDependency(
            "org.jboss.shrinkwrap.test:test-dependency-test:jar:1.0.0", ScopeType.TEST, false, exclusion);

        // FIXME in Maven 3.1.x, scope of resolved dependencies is compile
        File[] files = Resolvers.use(MavenResolverSystem.class).loadPomFromFile("target/poms/test-parent.xml")
            .addDependency(dependency).resolve().using(new AcceptScopesStrategy(ScopeType.TEST)).as(File.class);
View Full Code Here

        final MavenDependencyExclusion exclusion = MavenDependencies
            .createExclusion("org.jboss.shrinkwrap.test:test-deps-f");
        final MavenDependencyExclusion exclusion2 = MavenDependencies
            .createExclusion("org.jboss.shrinkwrap.test:test-deps-g");
        final MavenDependency dependency = MavenDependencies.createDependency(
            "org.jboss.shrinkwrap.test:test-dependency-test:1.0.0", ScopeType.TEST, false, exclusion, exclusion2);

        // FIXME in Maven 3.1.x, scope of resolved dependencies is compile
        File[] files = Resolvers.use(MavenResolverSystem.class).loadPomFromFile("target/poms/test-parent.xml")
            .addDependency(dependency).resolve().using(new AcceptScopesStrategy(ScopeType.TEST)).as(File.class);
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependency

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.