当前位置: 首页>>代码示例>>Java>>正文


Java ScmLogger类代码示例

本文整理汇总了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() );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:27,代码来源:SvnJavaInfoCommandTest.java

示例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() );
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:26,代码来源:SvnJavaInfoCommandTest.java

示例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;
}
 
开发者ID:olamy,项目名称:maven-scm-provider-svnjava,代码行数:10,代码来源:ScmFileEventHandler.java

示例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;
}
 
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:13,代码来源:CreateMojo.java

示例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;
}
 
开发者ID:apache,项目名称:marmotta,代码行数:40,代码来源:MercurialInfoProvider.java

示例6: HgOutputConsumer

import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
HgOutputConsumer( ScmLogger logger )
{
    super( logger );
}
 
开发者ID:mojohaus,项目名称:buildnumber-maven-plugin,代码行数:5,代码来源:HgOutputConsumer.java

示例7: HgLogConsumer

import org.apache.maven.scm.log.ScmLogger; //导入依赖的package包/类
public HgLogConsumer(ScmLogger logger) {
    super(logger);
}
 
开发者ID:apache,项目名称:marmotta,代码行数:4,代码来源:MercurialInfoProvider.java


注:本文中的org.apache.maven.scm.log.ScmLogger类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。