本文整理汇总了Java中org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor.addDependencyConfiguration方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultDependencyDescriptor.addDependencyConfiguration方法的具体用法?Java DefaultDependencyDescriptor.addDependencyConfiguration怎么用?Java DefaultDependencyDescriptor.addDependencyConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor
的用法示例。
在下文中一共展示了DefaultDependencyDescriptor.addDependencyConfiguration方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDependencyDescriptor
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private static DefaultDependencyDescriptor createDependencyDescriptor(
final String groupId, final String artifactId, final String version) {
final ModuleRevisionId moduleRevisionId =
new ModuleRevisionId(new ModuleId(groupId, artifactId), version);
final DefaultDependencyDescriptor dependencyDescriptor =
new DefaultDependencyDescriptor(moduleRevisionId, false);
dependencyDescriptor.addDependencyConfiguration("default", "default");
return dependencyDescriptor;
}
示例2: addConf
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
void addConf(DefaultDependencyDescriptor dd, String masterConf) {
if (mapped != null) {
for (String map : splitToArray(mapped)) {
dd.addDependencyConfiguration(masterConf, map);
}
}
for (IvyDependencyConfMapped m : mappeds) {
dd.addDependencyConfiguration(masterConf, m.name);
}
}
示例3: buildResolvedCapabilityMd
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private MDResolvedResource buildResolvedCapabilityMd(DependencyDescriptor dd,
ModuleDescriptor md) {
String org = dd.getDependencyRevisionId().getOrganisation();
String name = dd.getDependencyRevisionId().getName();
String rev = md.getExtraInfoContentByTagName(BundleInfoAdapter.EXTRA_INFO_EXPORT_PREFIX
+ name);
ModuleRevisionId capabilityRev = ModuleRevisionId.newInstance(org, name, rev,
Collections.singletonMap(CAPABILITY_EXTRA_ATTR, md.getModuleRevisionId().toString()));
DefaultModuleDescriptor capabilityMd = new DefaultModuleDescriptor(capabilityRev,
getSettings().getStatusManager().getDefaultStatus(), new Date());
String useConf = BundleInfoAdapter.CONF_USE_PREFIX + dd.getDependencyRevisionId().getName();
capabilityMd.addConfiguration(BundleInfoAdapter.CONF_DEFAULT);
capabilityMd.addConfiguration(BundleInfoAdapter.CONF_OPTIONAL);
capabilityMd.addConfiguration(BundleInfoAdapter.CONF_TRANSITIVE_OPTIONAL);
capabilityMd.addConfiguration(new Configuration(useConf));
DefaultDependencyDescriptor capabilityDD = new DefaultDependencyDescriptor(
md.getModuleRevisionId(), false);
capabilityDD.addDependencyConfiguration(BundleInfoAdapter.CONF_NAME_DEFAULT,
BundleInfoAdapter.CONF_NAME_DEFAULT);
capabilityDD.addDependencyConfiguration(BundleInfoAdapter.CONF_NAME_OPTIONAL,
BundleInfoAdapter.CONF_NAME_OPTIONAL);
capabilityDD.addDependencyConfiguration(BundleInfoAdapter.CONF_NAME_TRANSITIVE_OPTIONAL,
BundleInfoAdapter.CONF_NAME_TRANSITIVE_OPTIONAL);
capabilityDD.addDependencyConfiguration(useConf, useConf);
capabilityMd.addDependency(capabilityDD);
MetadataArtifactDownloadReport report = new MetadataArtifactDownloadReport(null);
report.setDownloadStatus(DownloadStatus.NO);
report.setSearched(true);
ResolvedModuleRevision rmr = new ResolvedModuleRevision(this, this, capabilityMd, report);
return new MDResolvedResource(null, capabilityMd.getRevision(), rmr);
}
示例4: requirementAsDependency
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private static void requirementAsDependency(DefaultModuleDescriptor md, BundleInfo bundleInfo,
Set<String> exportedPkgNames) {
for (BundleRequirement requirement : bundleInfo.getRequirements()) {
String type = requirement.getType();
String name = requirement.getName();
if (BundleInfo.PACKAGE_TYPE.equals(type) && exportedPkgNames.contains(name)) {
// don't declare package exported by the current bundle
continue;
}
if (BundleInfo.EXECUTION_ENVIRONMENT_TYPE.equals(type)) {
// execution environment are handled elsewhere
continue;
}
ModuleRevisionId ddmrid = asMrid(type, name, requirement.getVersion());
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(ddmrid, false);
String conf = CONF_NAME_DEFAULT;
if (BundleInfo.PACKAGE_TYPE.equals(type)) {
// declare the configuration for the package
conf = CONF_USE_PREFIX + name;
md.addConfiguration(new Configuration(CONF_USE_PREFIX + name, PUBLIC,
"Exported package " + name, new String[] {CONF_NAME_DEFAULT}, true, null));
dd.addDependencyConfiguration(conf, conf);
}
if ("optional".equals(requirement.getResolution())) {
dd.addDependencyConfiguration(CONF_NAME_OPTIONAL, conf);
dd.addDependencyConfiguration(CONF_NAME_TRANSITIVE_OPTIONAL,
CONF_NAME_TRANSITIVE_OPTIONAL);
} else {
dd.addDependencyConfiguration(CONF_NAME_DEFAULT, conf);
}
md.addDependency(dd);
}
}
示例5: addMappingConfs
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
public void addMappingConfs(DefaultDependencyDescriptor dd, boolean isOptional) {
if (isOptional) {
dd.addDependencyConfiguration("optional", "compile(*)");
// dd.addDependencyConfiguration("optional", "provided(*)");
dd.addDependencyConfiguration("optional", "master(*)");
} else {
dd.addDependencyConfiguration("compile", "compile(*)");
// dd.addDependencyConfiguration("compile", "provided(*)");
dd.addDependencyConfiguration("compile", "master(*)");
dd.addDependencyConfiguration("runtime", "runtime(*)");
}
}
示例6: doParsePom
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private void doParsePom(DescriptorParseContext parserSettings, GradlePomModuleDescriptorBuilder mdBuilder, PomReader pomReader) throws IOException, SAXException {
if (pomReader.hasParent()) {
//Is there any other parent properties?
ModuleVersionIdentifier parentId = DefaultModuleVersionIdentifier.newId(
pomReader.getParentGroupId(),
pomReader.getParentArtifactId(),
pomReader.getParentVersion());
PomReader parentPomReader = parseOtherPom(parserSettings, parentId);
pomReader.setPomParent(parentPomReader);
}
pomReader.resolveGAV();
String groupId = pomReader.getGroupId();
String artifactId = pomReader.getArtifactId();
String version = pomReader.getVersion();
mdBuilder.setModuleRevId(groupId, artifactId, version);
mdBuilder.setHomePage(pomReader.getHomePage());
mdBuilder.setDescription(pomReader.getDescription());
mdBuilder.setLicenses(pomReader.getLicenses());
ModuleRevisionId relocation = pomReader.getRelocation();
if (relocation != null) {
if (groupId != null && artifactId != null
&& artifactId.equals(relocation.getName())
&& groupId.equals(relocation.getOrganisation())) {
LOGGER.error("POM relocation to an other version number is not fully supported in Gradle : {} relocated to {}.",
mdBuilder.getModuleDescriptor().getModuleRevisionId(), relocation);
LOGGER.warn("Please update your dependency to directly use the correct version '{}'.", relocation);
LOGGER.warn("Resolution will only pick dependencies of the relocated element. Artifacts and other metadata will be ignored.");
PomReader relocatedModule = parseOtherPom(parserSettings, DefaultModuleVersionIdentifier.newId(relocation));
Collection<PomDependencyData> pomDependencyDataList = relocatedModule.getDependencies().values();
for(PomDependencyData pomDependencyData : pomDependencyDataList) {
mdBuilder.addDependency(pomDependencyData);
}
} else {
LOGGER.info(mdBuilder.getModuleDescriptor().getModuleRevisionId()
+ " is relocated to " + relocation
+ ". Please update your dependencies.");
LOGGER.debug("Relocated module will be considered as a dependency");
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(mdBuilder.getModuleDescriptor(), relocation, true, false, true);
/* Map all public dependencies */
Configuration[] m2Confs = GradlePomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS;
for (Configuration m2Conf : m2Confs) {
if (Visibility.PUBLIC.equals(m2Conf.getVisibility())) {
dd.addDependencyConfiguration(m2Conf.getName(), m2Conf.getName());
}
}
mdBuilder.addDependency(dd);
}
} else {
overrideDependencyMgtsWithImported(parserSettings, pomReader);
for (PomDependencyData dependency : pomReader.getDependencies().values()) {
mdBuilder.addDependency(dependency);
}
}
}
示例7: addDependencyConfiguration
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private void addDependencyConfiguration(String configuration, ModuleDependency dependency,
DefaultDependencyDescriptor dependencyDescriptor) {
dependencyDescriptor.addDependencyConfiguration(configuration, dependency.getConfiguration());
}
示例8: generateModules
import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; //导入方法依赖的package包/类
private void generateModules(int nbModules, int minDependencies, int maxDependencies,
int minVersions, int maxVersions) throws IOException {
int nb = 0;
int curDep = 1;
int varDeps = maxDependencies - minDependencies;
int varVersions = maxVersions - minVersions;
Random r = new Random(System.currentTimeMillis());
while (nb < nbModules) {
int deps = minDependencies + r.nextInt(varDeps + 1);
int versions = minVersions + r.nextInt(varVersions + 1);
int prevCurDep = curDep;
for (int ver = 0; ver < versions; ver++) {
DefaultModuleDescriptor md = new DefaultModuleDescriptor(
ModuleRevisionId.newInstance("apache", "mod" + nb, "1." + ver),
"integration", new Date());
curDep = prevCurDep;
for (int i = 0; i < deps && curDep < nbModules; i++) {
int d;
if (i % 2 == 1) {
d = nb + i;
if (d >= prevCurDep) {
d = curDep;
curDep++;
}
} else {
d = curDep;
curDep++;
}
DefaultDependencyDescriptor dd = new DefaultDependencyDescriptor(
md,
ModuleRevisionId.newInstance("apache", "mod" + d, "latest.integration"),
false, false, true);
dd.addDependencyConfiguration("default", "default");
md.addDependency(dd);
}
XmlModuleDescriptorWriter.write(md, new File("build/test/perf/mod" + nb + "/ivy-1."
+ ver + ".xml"));
FileUtil.copy(new File("test/repositories/1/org1/mod1.1/jars/mod1.1-1.0.jar"),
new File("build/test/perf/mod" + nb + "/mod" + nb + "-1." + ver + ".jar"), null);
}
nb++;
}
}