IvyDependencyExclude exclude = (IvyDependencyExclude) itExcludes.next(); DefaultExcludeRule rule = exclude.asRule(settings); dd.addExcludeRule(masterConf, rule);
protected void addConfiguration(String c) { confAware.addConfiguration(c); if (state == State.EXCLUDE) { // we are adding a configuration to a module wide exclude rule // we have nothing special to do here, the rule has already been added to the module // descriptor } else { // we are currently adding a configuration to either an include, exclude or artifact // element // of a dependency. This means that we have to add this element to the corresponding // conf // of the current dependency descriptor if (confAware instanceof DependencyArtifactDescriptor) { dd.addDependencyArtifact(c, (DependencyArtifactDescriptor) confAware); } else if (confAware instanceof IncludeRule) { dd.addIncludeRule(c, (IncludeRule) confAware); } else if (confAware instanceof ExcludeRule) { dd.addExcludeRule(c, (ExcludeRule) confAware); } } }
PatternMatcher matcher = new ExactOrRegexpPatternMatcher(); ExcludeRule excludeRule = new DefaultExcludeRule(aid, matcher, new HashMap()); depDescriptor.addExcludeRule("default", excludeRule);
public void addArtifact(String groupId, String artifactId, String version) throws Exception { artifacts.add(groupId+":"+artifactId+":"+version); String[] dep = null; dep = new String[] { groupId, artifactId, version }; if (md == null) { md = DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance(dep[0], dep[1] + "-caller", "working")); } DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(dep[0], dep[1], dep[2]), false, false, true); md.addDependency(dd); ExcludeRule er = new DefaultExcludeRule(new ArtifactId(new ModuleId("org.walkmod", "walkmod-core"), PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION), ExactPatternMatcher.INSTANCE, null); dd.addExcludeRule(null, er); }
public void addArtifact(String groupId, String artifactId, String version) throws Exception { artifacts.add(groupId+":"+artifactId+":"+version); String[] dep = null; dep = new String[] { groupId, artifactId, version }; if (md == null) { md = DefaultModuleDescriptor.newDefaultInstance(ModuleRevisionId.newInstance(dep[0], dep[1] + "-caller", "working")); } DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(md, ModuleRevisionId.newInstance(dep[0], dep[1], dep[2]), false, false, true); md.addDependency(dd); ExcludeRule er = new DefaultExcludeRule(new ArtifactId(new ModuleId("org.walkmod", "walkmod-core"), PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION), ExactPatternMatcher.INSTANCE, null); dd.addExcludeRule(null, er); }
String[] confs = dd.getModuleConfigurations(); for (int k = 0; k < confs.length; k++) { dd.addExcludeRule(confs[k], new DefaultExcludeRule(new ArtifactId(excludedModule, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION, PatternMatcher.ANY_EXPRESSION), ExactPatternMatcher.INSTANCE, null));