本文整理汇总了Java中org.apache.maven.scm.log.ScmLogger类的典型用法代码示例。如果您正苦于以下问题:Java ScmLogger类的具体用法?Java ScmLogger怎么用?Java ScmLogger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScmLogger类属于org.apache.maven.scm.log包,在下文中一共展示了ScmLogger类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInfo
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
@Test
public void testInfo()
throws Exception
{
prepareCopy();
ScmManager scmManager = (ScmManager) lookup( ScmManager.ROLE );
String url = System.getProperty( "scmUrlProject" );
String scmUrl = "scm:javasvn:" + url;
SvnJavaScmProviderRepository repository =
new SvnJavaScmProviderRepository( SVNURL.parseURIEncoded( url ), scmUrl );
SvnJavaScmProvider provider = (SvnJavaScmProvider) scmManager.getProviderByUrl( scmUrl );
InfoScmResult result = provider.info( repository, new ScmFileSet( checkoutPath.toFile() ), null );
InfoItem item = result.getInfoItems().get( 0 );
assertTrue( item.getRevision() != null );
SvnJavaInfoCommand command = new SvnJavaInfoCommand();
ScmLogger logger = new DefaultLog();
command.setLogger(logger);
result = command.executeInfoCommand( repository, new ScmFileSet( checkoutPath.toFile() ), null, true, null );
item = result.getInfoItems().get( 0 );
assertTrue( item.getRevision() != null );
System.out.println( item.getRevision() );
}
示例2: testInfoLocale
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
public void testInfoLocale()
throws Exception
{
prepareCopy();
ScmManager scmManager = (ScmManager) lookup( ScmManager.ROLE );
String url = getBasedir();
String scmUrl = "scm:javasvn:" + url;
SvnJavaScmProviderRepository repository =
new SvnJavaScmProviderRepository( SVNURL.fromFile( checkoutPath.toFile() ), scmUrl );
SvnJavaScmProvider provider = (SvnJavaScmProvider) scmManager.getProviderByUrl( scmUrl );
InfoScmResult result = provider.info( repository, new ScmFileSet( checkoutPath.toFile() ), null );
InfoItem item = result.getInfoItems().get( 0 );
assertTrue( item.getRevision() != null );
SvnJavaInfoCommand command = new SvnJavaInfoCommand();
ScmLogger logger = new DefaultLog();
command.setLogger(logger);
result = command.executeInfoCommand( repository, new ScmFileSet( checkoutPath.toFile() ), null, true, null );
item = result.getInfoItems().get( 0 );
assertTrue( item.getRevision() != null );
System.out.println( item.getRevision() );
}
示例3: ScmFileEventHandler
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
/**
* The logger is used in alerting the user to unknown file statuses.
*/
public ScmFileEventHandler( ScmLogger logger, File baseDirectory )
{
this.logger = logger;
this.baseDirectory = baseDirectory;
}
示例4: getLogger
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
/**
* @return
* @todo normally this would be handled in AbstractScmProvider
*/
private ScmLogger getLogger()
{
if ( logger == null )
{
logger = new ScmLogDispatcher();
}
return logger;
}
示例5: getInfo
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
public Map<String, String> getInfo(MavenProject project) {
ScmLogger logger = new DefaultLog();
HgLogConsumer consumer = new HgLogConsumer(logger);
ScmResult result = null;
try {
result = HgUtils.execute(
consumer,
logger,
project.getBasedir(),
new String[]{HgCommandConstants.REVNO_CMD, "-n", "-i", "-b"});
} catch (ScmException e) {
if (logger.isErrorEnabled()) {
logger.error(e.getMessage());
}
}
Map<String, String> info = new LinkedHashMap<String, String>();
if (result != null) {
if (result.isSuccess()) {
String output = result.getCommandOutput();
if (output != null) {
Matcher matcher = HG_OUTPUT_PATTERN.matcher(output);
if (matcher.find() && matcher.groupCount() == 3) {
StringBuilder changeset = new StringBuilder();
changeset.append("r").append(matcher.group(2)).append(":").append(matcher.group(1));
info.put("build.changeset", changeset.toString());
info.put("build.branch", matcher.group(3));
info.put("build.revision", matcher.group(2));
info.put("build.revhash", matcher.group(1));
} else {
info.put("hg.error", "The command returned incorrect number of arguments");
}
}
} else {
info.put("hg.error", result.getProviderMessage());
}
}
return info;
}
示例6: HgOutputConsumer
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
HgOutputConsumer( ScmLogger logger )
{
super( logger );
}
示例7: HgLogConsumer
import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
public HgLogConsumer(ScmLogger logger) {
super(logger);
}