本文整理汇总了Java中org.apache.ivy.core.module.descriptor.ModuleDescriptor.getArtifacts方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleDescriptor.getArtifacts方法的具体用法?Java ModuleDescriptor.getArtifacts怎么用?Java ModuleDescriptor.getArtifacts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.ModuleDescriptor
的用法示例。
在下文中一共展示了ModuleDescriptor.getArtifacts方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSimple
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testSimple() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-simple.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(PomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS),
Arrays.asList(md.getConfigurations()));
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
assertEquals("jar", artifact[0].getExt());
assertEquals("jar", artifact[0].getType());
}
示例2: testPackaging
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testPackaging() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-packaging.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
assertEquals("war", artifact[0].getExt());
assertEquals("war", artifact[0].getType());
}
示例3: testEjbPackaging
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testEjbPackaging() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-ejb-packaging.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
assertEquals("jar", artifact[0].getExt());
assertEquals("ejb", artifact[0].getType());
}
示例4: testModel
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testModel() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-model.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(PomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS),
Arrays.asList(md.getConfigurations()));
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
assertEquals("jar", artifact[0].getExt());
assertEquals("jar", artifact[0].getType());
}
示例5: testPublicationDefaultConf
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testPublicationDefaultConf() throws Exception {
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-publication-defaultconf.xml"), true);
assertNotNull(md);
Artifact[] artifacts = md.getArtifacts("default");
assertNotNull(artifacts);
assertEquals(3, artifacts.length);
artifacts = md.getArtifacts("test");
assertNotNull(artifacts);
assertEquals(2, artifacts.length);
artifacts = md.getArtifacts("other");
assertNotNull(artifacts);
assertEquals(1, artifacts.length);
}
示例6: findFirstArtifactRef
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
protected ResolvedResource findFirstArtifactRef(ModuleDescriptor md, DependencyDescriptor dd,
ResolveData data) {
for (String configName : md.getConfigurationsNames()) {
for (Artifact artifact : md.getArtifacts(configName)) {
ResolvedResource ret = getArtifactRef(artifact, data.getDate());
if (ret != null) {
return ret;
}
}
}
return null;
}
示例7: testParent
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testParent() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-parent.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
}
示例8: testParent2
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testParent2() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-parent2.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
}
示例9: testParentVersion
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testParentVersion() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-parent.version.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
}
示例10: testParentGroupId
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testParentGroupId() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-parent.groupid.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
}
示例11: testProjectParentVersion
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testProjectParentVersion() throws Exception {
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-project.parent.version.pom"), false);
assertNotNull(md);
ModuleRevisionId mrid = ModuleRevisionId.newInstance("org.apache", "test", "1.0");
assertEquals(mrid, md.getModuleRevisionId());
Artifact[] artifact = md.getArtifacts("master");
assertEquals(1, artifact.length);
assertEquals(mrid, artifact[0].getModuleRevisionId());
assertEquals("test", artifact[0].getName());
}
示例12: testArtifactsDefaults
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testArtifactsDefaults() throws Exception {
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-artifacts-defaults.xml"), true);
assertNotNull(md);
Artifact[] artifacts = md.getArtifacts("default");
assertNotNull(artifacts);
assertEquals(3, artifacts.length);
assertArtifactEquals("mymodule", "jar", "jar", artifacts[0]);
assertArtifactEquals("myartifact", "jar", "jar", artifacts[1]);
assertArtifactEquals("mymodule", "dll", "dll", artifacts[2]);
}
示例13: testExtraAttributes
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
@Test
public void testExtraAttributes() throws Exception {
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-extra-attributes.xml"), false);
assertNotNull(md);
assertEquals("infoextravalue", md.getAttribute("infoextra"));
assertEquals("infoextravalue", md.getModuleRevisionId().getAttribute("infoextra"));
assertEquals("confextravalue", md.getConfiguration("default").getAttribute("confextra"));
Artifact[] artifacts = md.getArtifacts("default");
assertEquals(1, artifacts.length);
Artifact art = artifacts[0];
assertEquals("art1", art.getName());
assertEquals("artextravalue", art.getAttribute("artextra"));
DependencyDescriptor[] dependencies = md.getDependencies();
assertNotNull(dependencies);
assertEquals(1, dependencies.length);
DependencyDescriptor dd = getDependency(dependencies, "mymodule1");
assertNotNull(dd);
assertEquals("myorg", dd.getDependencyId().getOrganisation());
assertEquals("1.0", dd.getDependencyRevisionId().getRevision());
assertEquals("depextravalue", dd.getAttribute("depextra"));
assertEquals("depextravalue", dd.getDependencyRevisionId().getAttribute("depextra"));
}