本文整理汇总了Java中org.apache.ivy.util.DefaultMessageLogger类的典型用法代码示例。如果您正苦于以下问题:Java DefaultMessageLogger类的具体用法?Java DefaultMessageLogger怎么用?Java DefaultMessageLogger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultMessageLogger类属于org.apache.ivy.util包,在下文中一共展示了DefaultMessageLogger类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() {
cleanTestDir();
cleanRep();
createCache();
project = TestHelper.newProject();
project.init();
project.setProperty("ivy.settings.file", "test/repositories/ivysettings.xml");
project.setProperty("build", "build/test/publish");
publish = new IvyPublish();
publish.setProject(project);
System.setProperty("ivy.cache.dir", cache.getAbsolutePath());
Message.setDefaultLogger(new DefaultMessageLogger(10));
}
示例2: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
File f = File.createTempFile("ivycache", ".dir");
ivy = new Ivy();
ivy.configureDefault();
ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
IvyContext.pushNewContext().setIvy(ivy);
IvySettings settings = ivy.getSettings();
f.delete(); // we want to use the file as a directory, so we delete the file itself
cacheManager = new DefaultRepositoryCacheManager();
cacheManager.setSettings(settings);
cacheManager.setBasedir(f);
artifact = createArtifact("org", "module", "rev", "name", "type", "ext");
Artifact originArtifact = createArtifact("org", "module", "rev", "name", "pom.original",
"pom");
origin = new ArtifactOrigin(originArtifact, true, "file:/some/where.pom");
cacheManager.saveArtifactOrigin(originArtifact, origin);
cacheManager.saveArtifactOrigin(artifact, origin);
}
示例3: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
Message.setDefaultLogger(new DefaultMessageLogger(99));
settings = new IvySettings();
ResolveEngine engine = new ResolveEngine(settings, new EventManager(), new SortEngine(
settings));
cache = new File("build/cache");
data = new ResolveData(engine, new ResolveOptions());
cache.mkdirs();
settings.setDefaultCache(cache);
// Create work space with build and resource cache directories
workdir = new File("build/test/PackagerResolverTest");
builddir = new File(workdir, "build");
cachedir = new File(workdir, "resources");
cleanupTempDirs();
if (!builddir.mkdirs() || !cachedir.mkdirs()) {
throw new Exception("can't create directories under " + workdir);
}
}
示例4: initMessage
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
private static void initMessage(CommandLine line, Ivy ivy) {
if (line.hasOption("debug")) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
} else if (line.hasOption("verbose")) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_VERBOSE));
} else if (line.hasOption("warn")) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_WARN));
} else if (line.hasOption("error")) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_ERR));
} else {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_INFO));
}
}
示例5: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() {
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_WARN));
settings = new IvySettings();
// prevent test from polluting local cache
settings.setDefaultCache(new File("build/cache"));
}
示例6: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
ivy = Ivy.newInstance();
ivy.configure(new File("test/repositories/ivysettings.xml"));
TestHelper.createCache();
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_INFO));
}
示例7: setUp
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Before
public void setUp() {
Message.setDefaultLogger(new DefaultMessageLogger(Message.MSG_WARN));
this.settings = new IvySettings();
// prevent test from polluting local cache
settings.setDefaultCache(new File("build/cache"));
}
示例8: configure
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Ivy configure() throws Exception {
boolean verbose = System.getProperty("verbose") != null;
boolean debug = System.getProperty("debug") != null;
HumanReadyLogger humanReadyLogger = new HumanReadyLogger();
IvySettings ivySettings = new IvySettings();
new SettingsParser(humanReadyLogger).parse(ivySettings, new File(framework, "framework/dependencies.yml"));
new SettingsParser(humanReadyLogger).parse(ivySettings, new File(application, "conf/dependencies.yml"));
ivySettings.setDefaultResolver("mavenCentral");
ivySettings.setDefaultUseOrigin(true);
PlayConflictManager conflictManager = new PlayConflictManager();
ivySettings.addConflictManager("playConflicts", conflictManager);
ivySettings.addConflictManager("defaultConflicts", conflictManager.deleguate);
ivySettings.setDefaultConflictManager(conflictManager);
Ivy ivy = Ivy.newInstance(ivySettings);
// Default ivy config see: http://play.lighthouseapp.com/projects/57987-play-framework/tickets/807
File ivyDefaultSettings = new File(userHome, ".ivy2/ivysettings.xml");
if(ivyDefaultSettings.exists()) {
ivy.configure(ivyDefaultSettings);
}
if (debug) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_DEBUG));
} else if (verbose) {
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_INFO));
} else {
logger = humanReadyLogger;
ivy.getLoggerEngine().setDefaultLogger(logger);
}
ivy.pushContext();
return ivy;
}
示例9: Retrieve
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Retrieve(URL ivySettings, String cacheDir) throws Exception {
this.ivySettings = ivySettings;
this.cacheDir = cacheDir;
ivy = Ivy.newInstance();
ivy.setVariable("cache", cacheDir);
if (!log.isDebugEnabled()) {
ivy.setVariable("log", "quiet");
ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_ERR));
}
ivy.configure(ivySettings);
}
示例10: Discover
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
public Discover(URL ivySettings, String cacheDir) throws Exception {
this.ivySettings = ivySettings;
this.cacheDir = cacheDir;
ivy = Ivy.newInstance();
ivy.setVariable("cache", cacheDir);
if (!log.isDebugEnabled()) {
ivy.setVariable("log", "quiet");
ivy.getLoggerEngine().setDefaultLogger(new DefaultMessageLogger(Message.MSG_ERR));
}
ivy.configure(ivySettings);
}
示例11: testExtendsAll
import org.apache.ivy.util.DefaultMessageLogger; //导入依赖的package包/类
@Test
public void testExtendsAll() throws Exception {
Message.setDefaultLogger(new DefaultMessageLogger(99));
// default extends type is 'all' when no extendsType attribute is specified.
ModuleDescriptor md = XmlModuleDescriptorParser.getInstance().parseDescriptor(settings,
getClass().getResource("test-extends-all.xml"), true);
assertNotNull(md);
assertEquals("myorg", md.getModuleRevisionId().getOrganisation());
assertEquals("mymodule", md.getModuleRevisionId().getName());
assertEquals("myrev", md.getModuleRevisionId().getRevision());
assertEquals("integration", md.getStatus());
// verify that the parent description was merged.
assertEquals("Parent module description.", md.getDescription());
// verify that the parent and child configurations were merged together.
final Configuration[] expectedConfs = {new Configuration("default"),
new Configuration("conf1"), new Configuration("conf2")};
assertNotNull(md.getConfigurations());
assertEquals(Arrays.asList(expectedConfs), Arrays.asList(md.getConfigurations()));
// verify parent and child dependencies were merged together.
DependencyDescriptor[] deps = md.getDependencies();
assertNotNull(deps);
assertEquals(2, deps.length);
assertEquals(Collections.singletonList("default"),
Arrays.asList(deps[0].getModuleConfigurations()));
ModuleRevisionId dep = deps[0].getDependencyRevisionId();
assertEquals("myorg", dep.getModuleId().getOrganisation());
assertEquals("mymodule1", dep.getModuleId().getName());
assertEquals("1.0", dep.getRevision());
assertEquals(Arrays.asList("conf1", "conf2"),
Arrays.asList(deps[1].getModuleConfigurations()));
dep = deps[1].getDependencyRevisionId();
assertEquals("myorg", dep.getModuleId().getOrganisation());
assertEquals("mymodule2", dep.getModuleId().getName());
assertEquals("2.0", dep.getRevision());
// verify only child publications are present
Artifact[] artifacts = md.getAllArtifacts();
assertNotNull(artifacts);
assertEquals(1, artifacts.length);
assertEquals("mymodule", artifacts[0].getName());
assertEquals("jar", artifacts[0].getType());
}