public static Exclusion cloneDependencyExclusion( Exclusion src ) { if ( src == null ) { return null; } Exclusion result = new Exclusion(); result.setArtifactId( src.getArtifactId() ); result.setGroupId( src.getGroupId() ); return result; }
public static Exclusion cloneExclusion( Exclusion src ) { Exclusion result = null; if ( src != null ) { result = new Exclusion(); result.setArtifactId( src.getArtifactId() ); result.setGroupId( src.getGroupId() ); } return result; }
Exclusion exclusion = new Exclusion(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
public default Exclusion exclusion(NamedValue... keyValuePairs) { Exclusion exclusion = new Exclusion(); return NamedValueProcessor.namedToObject(exclusion, keyValuePairs); }
Exclusion exclusion = new Exclusion(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException { Exclusion node; if (value != null) { node = parse(value); if (node == null) { throw new NodeValueParseException(this, value); } } else { node = new Exclusion(); } return node; }
public static Exclusion parse(final Object value) { assert value != null; if (value instanceof String) { Exclusion node = new Exclusion(); String[] items = ((String) value).split(":"); switch (items.length) { case 2: node.setGroupId(items[0]); node.setArtifactId(items[1]); return node; } } return null; } }
Exclusion exclusion = new Exclusion(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
for (String exclusionStr : exclusions) { String[] parts = exclusionStr.split(":"); Exclusion exclusion = new Exclusion(); exclusion.setGroupId(parts[0]); exclusion.setArtifactId(parts[1]);
public static Exclusion parse(final Object value) { assert value != null; if (value instanceof String) { Exclusion node = new Exclusion(); String[] items = ((String) value).split(":"); switch (items.length) { case 2: node.setGroupId(items[0]); node.setArtifactId(items[1]); return node; } } return null; } }
public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attrs) throws InstantiationException, IllegalAccessException { Exclusion node; if (value != null) { node = parse(value); if (node == null) { throw new NodeValueParseException(this, value); } } else { node = new Exclusion(); } return node; }
private List<Exclusion> transformExclusions(List<Coordinate> excludedDependencies) { List<Exclusion> result = new ArrayList<Exclusion>(excludedDependencies.size()); for (Coordinate dependency : excludedDependencies) { Exclusion exclusion = new Exclusion(); exclusion.setArtifactId(dependency.getArtifactId()); exclusion.setGroupId(dependency.getGroupId()); result.add(exclusion); } return result; }
public List<Exclusion> parseExclusions(String exclusions) { List<Exclusion> result = new ArrayList<>(); if (StringUtils.isBlank(exclusions)) { return result; } Pattern.compile(";") .splitAsStream(exclusions) .forEach(s -> { String[] mavenIds = Pattern.compile(":").split(s, 2); if (mavenIds.length == 2) { Exclusion exclusion = new Exclusion(); exclusion.setGroupId(mavenIds[0]); exclusion.setArtifactId(mavenIds[1]); result.add(exclusion); } } ); return result; }
private void setExclusions(final Collection<org.sonatype.aether.graph.Exclusion> exclusions) { List<Exclusion> result = new ArrayList<Exclusion>(); for (org.sonatype.aether.graph.Exclusion exclusion : exclusions) { Exclusion temp = new Exclusion(); temp.setArtifactId(exclusion.getArtifactId()); temp.setGroupId(exclusion.getGroupId()); result.add(temp); } super.setExclusions(result); }
private void setExclusions(final Collection<org.eclipse.aether.graph.Exclusion> exclusions) { List<Exclusion> result = new ArrayList<>(); for (org.eclipse.aether.graph.Exclusion exclusion : exclusions) { Exclusion temp = new Exclusion(); temp.setArtifactId(exclusion.getArtifactId()); temp.setGroupId(exclusion.getGroupId()); result.add(temp); } super.setExclusions(result); }
private static Exclusion exclusion(String pom) { Exclusion exclusion = new Exclusion(); DefaultArtifact artifact = artifact(pom); exclusion.setGroupId(artifact.getGroupId()); exclusion.setArtifactId(artifact.getArtifactId()); return exclusion; }
@Test public void testTheResolutionWhenATransitiveDependencyIsMissingButOptional() { File local = new File("target/test-repos/incomplete"); new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact() .addDependency(new LocalDependency("org.acme", "acme-missing", "1.0").optional(true))).build(); Exclusion exclusion = new Exclusion(); exclusion.setArtifactId("acme-missing"); exclusion.setGroupId("org.acme"); Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt"); Stack stack = new Stack() .addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0")) .addDependency(dependency); StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true) .setLocalRepository(local.getAbsolutePath()); StackResolution resolution = new StackResolution(stack, root, options); Map<String, File> map = resolution.resolve(); assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0"); assertThat(map).containsKey("org.acme:acme:txt:1.0"); }
@Test public void testTheResolutionWhenATransitiveDependencyIsMissingButOptional() { File local = new File("target/test-repos/incomplete"); new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact() .addDependency(new LocalDependency("org.acme", "acme-missing", "1.0").optional(true))).build(); Exclusion exclusion = new Exclusion(); exclusion.setArtifactId("acme-missing"); exclusion.setGroupId("org.acme"); Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt"); Stack stack = new Stack() .addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0")) .addDependency(dependency); StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true) .setLocalRepository(local.getAbsolutePath()); StackResolution resolution = new StackResolution(stack, root, options); Map<String, File> map = resolution.resolve(); assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0"); assertThat(map).containsKey("org.acme:acme:txt:1.0"); }
@Test public void testTheResolutionWhenATransitiveDependencyIsMissingButExcluded() { File local = new File("target/test-repos/incomplete"); new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact() .addDependency(new LocalDependency("org.acme", "acme-missing", "1.0"))).build(); Exclusion exclusion = new Exclusion(); exclusion.setArtifactId("acme-missing"); exclusion.setGroupId("org.acme"); Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt"); dependency.addExclusion(exclusion); Stack stack = new Stack() .addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0")) .addDependency(dependency); StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true) .setLocalRepository(local.getAbsolutePath()); StackResolution resolution = new StackResolution(stack, root, options); Map<String, File> map = resolution.resolve(); assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0"); assertThat(map).containsKey("org.acme:acme:txt:1.0"); }
@Test public void testTheResolutionWhenATransitiveDependencyIsMissingButExcluded() { File local = new File("target/test-repos/incomplete"); new LocalRepoBuilder(local).addArtifact(new LocalArtifact("org.acme", "acme", "1.0").generateMainArtifact() .addDependency(new LocalDependency("org.acme", "acme-missing", "1.0"))).build(); Exclusion exclusion = new Exclusion(); exclusion.setArtifactId("acme-missing"); exclusion.setGroupId("org.acme"); Dependency dependency = new Dependency("org.acme", "acme", "1.0", "txt"); dependency.addExclusion(exclusion); Stack stack = new Stack() .addDependency(new Dependency("io.vertx", "vertx-core", "3.1.0")) .addDependency(dependency); StackResolutionOptions options = new StackResolutionOptions().setFailOnConflicts(true) .setLocalRepository(local.getAbsolutePath()); StackResolution resolution = new StackResolution(stack, root, options); Map<String, File> map = resolution.resolve(); assertThat(map).containsKey("io.vertx:vertx-core:jar:3.1.0"); assertThat(map).containsKey("org.acme:acme:txt:1.0"); }