CPD Results

The following document contains the results of PMD's CPD 7.0.0.

Duplications

File Line
org/apache/maven/resolver/examples/GetDependencyHierarchyWithConflicts.java 70
org/apache/maven/resolver/examples/GetDependencyHierarchyWithConflicts.java 114
Artifact artifact = new DefaultArtifact("org.apache.maven.shared:maven-dependency-tree:3.0.1");

                ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest();
                descriptorRequest.setArtifact(artifact);
                descriptorRequest.setRepositories(Booter.newRepositories(system, session));
                ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor(session, descriptorRequest);

                CollectRequest collectRequest = new CollectRequest();
                collectRequest.setRootArtifact(descriptorResult.getArtifact());
                collectRequest.setDependencies(descriptorResult.getDependencies());
                collectRequest.setManagedDependencies(descriptorResult.getManagedDependencies());
                collectRequest.setRepositories(descriptorRequest.getRepositories());

                system.collectDependencies(session, collectRequest);
                throw new IllegalStateException("should fail");
            }
        } catch (Exception e) {
            e.printStackTrace();
            if (e.getCause() instanceof UnsolvableVersionConflictException) {
                String cause = e.getCause().getMessage();
                if (!cause.contains(