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

Examples of org.jboss.shrinkwrap.resolver.api.maven.ScopeType


    static MavenResolvedArtifact fromArtifactResult(final ArtifactResult artifactResult) {
        final Artifact artifact = artifactResult.getArtifact();
        final DependencyNode root = artifactResult.getRequest().getDependencyNode();

        // SHRINKRES-143 lets ignore invalid scope
        ScopeType scopeType = ScopeType.RUNTIME;
        try {
            scopeType = ScopeType.fromScopeType(root.getDependency().getScope());
        } catch (IllegalArgumentException e) {
            // let scope be RUNTIME
            log.log(Level.WARNING, "Invalid scope {0} of retrieved dependency {1} will be replaced by <scope>runtime</scope>",
View Full Code Here


        final MavenCoordinate coordinate = MavenCoordinates.createCoordinate(artifact.getGroupId(),
                artifact.getArtifactId(), artifact.getVersion(), packaging, classifier);

        // SHRINKRES-143 lets ignore invalid scope
        ScopeType scope = ScopeType.RUNTIME;
        try {
            scope = ScopeType.fromScopeType(dependency.getScope());
        } catch (IllegalArgumentException e) {
            // let scope be RUNTIME
            log.log(Level.WARNING, "Invalid scope {0} of dependency {1} will be replaced by <scope>runtime</scope>",
View Full Code Here

        // SHRINKRES-123 Allow for depMgt explicitly not setting scope
        final String resolvedScope = dependency.getScope();
        final boolean undeclaredScope = resolvedScope == null;

        // SHRINKRES-143 lets ignore invalid scope
        ScopeType scope = ScopeType.RUNTIME;
        try {
            scope = ScopeType.fromScopeType(resolvedScope);
        } catch (IllegalArgumentException e) {
            // let scope be RUNTIME
            log.log(Level.WARNING, "Invalid scope {0} of dependency {1} will be replaced by <scope>runtime</scope>",
View Full Code Here

    static MavenArtifactInfo fromDependencyNode(final DependencyNode dependencyNode) {
        final Artifact artifact = dependencyNode.getDependency().getArtifact();
        final List<DependencyNode> children = dependencyNode.getChildren();

        // SHRINKRES-143 lets ignore invalid scope
        ScopeType scopeType = ScopeType.RUNTIME;
        try {
            scopeType = ScopeType.fromScopeType(dependencyNode.getDependency().getScope());
        } catch (IllegalArgumentException e) {
            // let scope be RUNTIME
            log.log(Level.WARNING, "Invalid scope {0} of retrieved dependency {1} will be replaced by <scope>runtime</scope>",
View Full Code Here

public class MavenDependencyImplTestCase {

    @Test
    public void equalsByValueNoExclusions() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependency dependency1 = new MavenDependencyImpl(coordinate, scope, optional);
        final MavenDependency dependency2 = new MavenDependencyImpl(coordinate, scope, optional);
        Assert.assertEquals(dependency1, dependency2);
    }
View Full Code Here

    }

    @Test
    public void equalsByValueExclusions() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependencyExclusion exclusion1 = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependencyExclusion exclusion2 = new MavenDependencyExclusionImpl("groupId2", "artifactId2");
        final MavenDependency dependency1 = new MavenDependencyImpl(coordinate, scope, optional, exclusion1, exclusion2);
        final MavenDependency dependency2 = new MavenDependencyImpl(coordinate, scope, optional, exclusion1, exclusion2);
View Full Code Here

    }

    @Test
    public void equalsByValueExclusionsUnordered() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependencyExclusion exclusion11 = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependencyExclusion exclusion12 = new MavenDependencyExclusionImpl("groupId2", "artifactId2");
        final MavenDependencyExclusion exclusion21 = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependencyExclusion exclusion22 = new MavenDependencyExclusionImpl("groupId2", "artifactId2");
View Full Code Here

    }

    @Test
    public void notEqualsByValueExclusions() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependencyExclusion exclusion1 = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependencyExclusion exclusion2 = new MavenDependencyExclusionImpl("wrong", "artifactId2");
        final MavenDependency dependency1 = new MavenDependencyImpl(coordinate, scope, optional, exclusion1);
        final MavenDependency dependency2 = new MavenDependencyImpl(coordinate, scope, optional, exclusion2);
View Full Code Here

    }

    @Test
    public void notEqualsByValueExclusionsMismatchThis() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependencyExclusion exclusion = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependency dependency1 = new MavenDependencyImpl(coordinate, scope, optional);
        final MavenDependency dependency2 = new MavenDependencyImpl(coordinate, scope, optional, exclusion);
        Assert.assertTrue(dependency1.equals(dependency2));
View Full Code Here

    }

    @Test
    public void notEqualsByValueExclusionsMismatchThat() {
        final MavenCoordinate coordinate = this.createCoordinate();
        final ScopeType scope = ScopeType.RUNTIME;
        final boolean optional = true;
        final MavenDependencyExclusion exclusion = new MavenDependencyExclusionImpl("groupId1", "artifactId1");
        final MavenDependency dependency1 = new MavenDependencyImpl(coordinate, scope, optional, exclusion);
        final MavenDependency dependency2 = new MavenDependencyImpl(coordinate, scope, optional);
        Assert.assertTrue(dependency1.equals(dependency2));
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.resolver.api.maven.ScopeType

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.