本文整理汇总了Java中org.apache.ivy.Ivy.popContext方法的典型用法代码示例。如果您正苦于以下问题:Java Ivy.popContext方法的具体用法?Java Ivy.popContext怎么用?Java Ivy.popContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.Ivy
的用法示例。
在下文中一共展示了Ivy.popContext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testResolveVersionRelocationChainedWithGroupRelocation
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
@Test
public void testResolveVersionRelocationChainedWithGroupRelocation() throws Exception {
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File(
"test/repositories/m2/org/relocated/test3/1.1/test3-1.1.pom"),
getResolveOptions(new String[] {"*"}));
assertNotNull(report);
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar",
"jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar")
.exists());
} finally {
ivy.popContext();
}
}
示例2: testResolveTransitivelyToRelocatedPom
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
@Test
public void testResolveTransitivelyToRelocatedPom() throws Exception {
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File(
"test/repositories/m2/org/relocated/testRelocationUser/1.0/"
+ "testRelocationUser-1.0.pom"),
getResolveOptions(new String[] {"compile"}));
assertNotNull(report);
assertFalse(report.hasError());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar",
"jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar")
.exists());
} finally {
ivy.popContext();
}
}
示例3: testResolveTransitivelyToPomRelocatedToNewVersion
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
@Test
public void testResolveTransitivelyToPomRelocatedToNewVersion() throws Exception {
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File(
"test/repositories/m2/org/relocated/testRelocationUser/1.1/"
+ "testRelocationUser-1.1.pom"),
getResolveOptions(new String[] {"compile"}));
assertNotNull(report);
assertFalse(report.hasError());
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar",
"jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar")
.exists());
} finally {
ivy.popContext();
}
}
示例4: testResolveMaven2RelocationOfGroupId
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
@Test
public void testResolveMaven2RelocationOfGroupId() throws Exception {
// Same as testResolveMaven2 but with a relocated module pointing to the module
// used in testResolveMaven2.
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File(
"test/repositories/m2/org/relocated/test3/1.0/test3-1.0.pom"),
getResolveOptions(new String[] {"*"}));
assertNotNull(report);
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar",
"jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar")
.exists());
} finally {
ivy.popContext();
}
}
示例5: testResolveMaven2FullRelocation
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
@Test
public void testResolveMaven2FullRelocation() throws Exception {
// Same as testResolveMaven2 but with a relocated module pointing to the module
// used in testResolveMaven2.
ivy = new Ivy();
ivy.configure(new File("test/repositories/m2/ivysettings.xml"));
ivy.pushContext();
try {
ResolveReport report = ivy.resolve(new File(
"test/repositories/m2/org/relocated/test3full/1.1/test3full-1.1.pom"),
getResolveOptions(new String[] {"*"}));
assertNotNull(report);
// dependencies
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test2", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test2", "1.0", "test2", "jar",
"jar").exists());
assertTrue(getIvyFileInCache(ModuleRevisionId.newInstance("org.apache", "test", "1.0"))
.exists());
assertTrue(getArchiveFileInCache(ivy, "org.apache", "test", "1.0", "test", "jar", "jar")
.exists());
} finally {
ivy.popContext();
}
}
示例6: createIvyEngine
import org.apache.ivy.Ivy; //导入方法依赖的package包/类
void createIvyEngine(final ProjectComponent task) {
Project project = task.getProject();
Property prop = new Property() {
public void execute() throws BuildException {
addProperties(getDefaultProperties(task));
}
};
prop.setProject(project);
prop.init();
prop.execute();
IvyAntVariableContainer ivyAntVariableContainer = new IvyAntVariableContainer(project);
IvySettings settings = new IvySettings(ivyAntVariableContainer);
settings.setBaseDir(project.getBaseDir());
if (file == null && url == null) {
defineDefaultSettingFile(ivyAntVariableContainer, task);
}
if (antWorkspaceResolver != null) {
settings.addConfigured(antWorkspaceResolver.getResolver());
}
Ivy ivy = Ivy.newInstance(settings);
try {
ivy.pushContext();
AntMessageLogger.register(task, ivy);
Message.showInfo();
configureURLHandler();
if (file != null) {
if (!file.exists()) {
throw new BuildException("settings file does not exist: " + file);
}
ivy.configure(file);
} else {
if (url == null) {
throw new AssertionError(
"ivy setting should have either a file, either an url,"
+ " and if not defineDefaultSettingFile must set it.");
}
ivy.configure(url);
}
ivyAntVariableContainer.updateProject(id);
ivyEngine = ivy;
} catch (ParseException | IOException e) {
throw new BuildException("impossible to configure ivy:settings with given "
+ (file != null ? "file: " + file : "url: " + url) + " : " + e, e);
} finally {
ivy.popContext();
}
}