/** * Parses exclusion parameter and build {@link Exclusion} object. * * @param exclusionString string representation of exclusion parameter * @return Exclusion object */ public static Exclusion createExclusion(String exclusionString) { String[] parts = exclusionString.split(":"); String artifactId = "*"; String classifier = "*"; String extension = "*"; int len = parts.length; if (len > 1) { artifactId = parts[1]; } if (len > 2) { classifier = parts[2]; } if (len > 3) { extension = parts[3]; } // length of parts should be greater than 0 String groupId = parts[0]; return new Exclusion(groupId, artifactId, classifier, extension); }
private Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private static Exclusion toExclusion( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
if (TESTS_CLASSIFIER.equals(toTransform.getArtifact().getClassifier())) { return toTransform.setScope(COMPILE).setExclusions(singleton(new Exclusion("*", "*", "*", "*"))); } else { return toTransform.setScope(COMPILE);
private Exclusion toExclusion(String s) { String[] ex = s.split(":", 2); return new Exclusion(ex[0], ex[1], null, null); }
private Exclusion createExclusion(Map<String, Object> exclusionMap) { String group = (String) exclusionMap.get("group"); String module = (String) exclusionMap.get("module"); return new Exclusion(group, module, "*", "*"); }
/** * Parses excludedArtifactsAsString and fills parsedExcludedArtifacts * @param excludedArtifactsAsString List of exclusion */ private void setupExcludedArtifacts(List<String> excludedArtifactsAsString) { // Exclude broken artifacts of old JMeter pom // 1/ See https://bz.apache.org/bugzilla/show_bug.cgi?id=57555 parsedExcludedArtifacts.add(new Exclusion("d-haven-managed-pool", "d-haven-managed-pool", null, null)); parsedExcludedArtifacts.add(new Exclusion("event", "event", null, null)); // 2/ See https://bz.apache.org/bugzilla/show_bug.cgi?id=57734 parsedExcludedArtifacts.add(new Exclusion("commons-pool2", "commons-pool2", null, null)); parsedExcludedArtifacts.add(new Exclusion("commons-math3", "commons-math3", null, null)); // Exclude conflicting libraries since JMeter 3.2 parsedExcludedArtifacts.add(new Exclusion("logkit", "logkit", null, null)); parsedExcludedArtifacts.add(new Exclusion("avalon-logkit", "avalon-logkit", null, null)); for (String exclusion : excludedArtifactsAsString) { String[] exclusionParts = exclusion.split(":"); parsedExcludedArtifacts.add( new Exclusion(exclusionParts[0], exclusionParts[1], exclusionParts.length>2 ? exclusionParts[2] : null, exclusionParts.length>3 ? exclusionParts[3] : null)); } }
public static Exclusion asExclusion(MavenDependencyExclusion coordinates) { String group = coordinates.getGroupId(); String artifact = coordinates.getArtifactId(); group = (group == null || group.length() == 0) ? "*" : group; artifact = (artifact == null || artifact.length() == 0) ? "*" : artifact; return new Exclusion(group, artifact, "*", "*"); }
public static Exclusion asExclusion(MavenDependencyExclusion coordinates) { String group = coordinates.getGroupId(); String artifact = coordinates.getArtifactId(); group = (group == null || group.length() == 0) ? "*" : group; artifact = (artifact == null || artifact.length() == 0) ? "*" : artifact; return new Exclusion(group, artifact, "*", "*"); }
private Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private static Exclusion toExclusion(org.apache.maven.model.Exclusion exclusion) { return new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*"); }
private Exclusion convert(org.apache.maven.model.Exclusion exclusion) { return new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*"); }
private org.eclipse.aether.graph.Exclusion convert( org.apache.maven.model.Exclusion exclusion ) { return new org.eclipse.aether.graph.Exclusion( exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*" ); }
private static Exclusion toExclusion(org.apache.maven.model.Exclusion exclusion) { return new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*"); }
private Dependency toAetherDependency(org.apache.maven.model.Dependency dependency) { Artifact artifact = new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), dependency.getType(), dependency.getVersion()); ImmutableList.Builder<Exclusion> exclusions = ImmutableList.builder(); for (org.apache.maven.model.Exclusion exclusion : dependency.getExclusions()) { exclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), null, "*")); } return new Dependency(artifact, dependency.getScope(), dependency.isOptional(), exclusions.build()); }
private List<Artifact> getDeployDependencies(Artifact artifact, List<Exclusion> exclusions, boolean testScope, Map<String, String> properties, DeployType type) { ArtifactDescriptorRequest descriptorRequest = new ArtifactDescriptorRequest(); descriptorRequest.setRepositories(AetherUtil.newRepositories(deployConfig)); descriptorRequest.setArtifact(artifact); Model model = AetherUtil.readPom(artifact); if (model == null) { throw new IllegalStateException("Unable to read POM for " + artifact.getFile()); } try { ArtifactDescriptorResult descriptorResult = system.readArtifactDescriptor(session, descriptorRequest); return descriptorResult.getDependencies().stream() .filter(d -> type == DeployType.DEFAULT || (type == DeployType.APPLICATION && !d.getArtifact().getExtension().equals("zip")) || (type == DeployType.ARTIFACT && !d.getArtifact().getExtension().equals("jar"))) .filter(d -> "compile".equalsIgnoreCase(d.getScope()) || ("test".equalsIgnoreCase(d.getScope()) && testScope)) .filter(d -> !exclusions.contains(new Exclusion(d.getArtifact().getGroupId(), d.getArtifact().getArtifactId(), null, null))) .map(Dependency::getArtifact) .map(d -> this.checkWithModel(model, d, properties)) .collect(Collectors.toList()); } catch (ArtifactDescriptorException e) { LOG.error("Unable to resolve dependencies for deploy artifact '{}', unable to auto-discover ", artifact, e); } return Collections.emptyList(); }
exclusions.add( new Exclusion( split[0], split[1], "*", "*" ) );
public void addDependencyManagement(DependencyManagement dependencyManagement) { for (org.springframework.boot.cli.compiler.dependencies.Dependency dependency : dependencyManagement .getDependencies()) { List<Exclusion> aetherExclusions = new ArrayList<>(); for (org.springframework.boot.cli.compiler.dependencies.Dependency.Exclusion exclusion : dependency .getExclusions()) { aetherExclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), "*", "*")); } Dependency aetherDependency = new Dependency( new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), "jar", dependency.getVersion()), JavaScopes.COMPILE, false, aetherExclusions); this.managedDependencies.add(0, aetherDependency); this.managedDependencyByGroupAndArtifact.put(getIdentifier(aetherDependency), aetherDependency); } this.dependencyManagement = (this.dependencyManagement != null) ? new CompositeDependencyManagement(dependencyManagement, this.dependencyManagement) : dependencyManagement; this.artifactCoordinatesResolver = new DependencyManagementArtifactCoordinatesResolver( this.dependencyManagement); }