Example usage for org.apache.maven.plugin.logging Log info

List of usage examples for org.apache.maven.plugin.logging Log info

Introduction

In this page you can find the example usage for org.apache.maven.plugin.logging Log info.

Prototype

void info(Throwable error);

Source Link

Document

Send an exception to the user in the info error level.
The stack trace for this exception will be output when this error level is enabled.

Usage

From source file:com.buisonje.AutoProxyMojo.java

License:Apache License

private void showMavenProxySettings(final Log mojoLog) {
    final org.apache.maven.settings.Proxy manuallyConfiguredActiveMavenProxy = settings.getActiveProxy();

    if (manuallyConfiguredActiveMavenProxy != null) {
        mojoLog.info("Manually configured active proxy found in settings.xml. Details:");
        mojoLog.info("  * Hostname: " + manuallyConfiguredActiveMavenProxy.getHost());
        mojoLog.info("  * Port    : " + manuallyConfiguredActiveMavenProxy.getPort());
        mojoLog.info("  * Protocol: " + manuallyConfiguredActiveMavenProxy.getProtocol());
    } else {/*from w  w w .j  a  va 2 s.co m*/
        mojoLog.info("No currently active proxy found in settings.xml.");
    }
}

From source file:com.carmatech.maven.model.MergerFactory.java

License:Apache License

private static IMerger getSimpleMerger(final Log logger) {
    logger.info("Creating " + SimpleMerger.class.getSimpleName() + "...");
    return new SimpleMerger();
}

From source file:com.carmatech.maven.model.MergerFactory.java

License:Apache License

private static IMerger getParallelMerger(final Log logger, final int numTotalSourceFiles) {
    logger.info("Creating " + ParallelMerger.class.getSimpleName() + "...");
    return new ParallelMerger(logger, ThreadingUtils.createThreadPool(logger, numTotalSourceFiles));
}

From source file:com.carmatech.maven.utils.ThreadingUtils.java

License:Apache License

public static ExecutorService createThreadPool(final Log logger, final int totalNumFiles) {
    final int degreeOfParallelism = Math.max(1,
            Math.min(Runtime.getRuntime().availableProcessors(), totalNumFiles));
    final ExecutorService threadPool = Executors.newFixedThreadPool(degreeOfParallelism);
    logger.info(
            "Created thread pool of size [" + degreeOfParallelism + "] in order to merge files in parallel.");
    return threadPool;
}

From source file:com.carrotgarden.maven.aws.util.Util.java

License:BSD License

public static void overrideInstanceProps(final Log log, final Object instance, final String prefix,
        final Map<String, String> props) {

    final Set<Map.Entry<String, String>> entrySet = //
            new HashSet<Entry<String, String>>(props.entrySet());

    final Class<?> klaz = instance.getClass();

    for (final Map.Entry<String, String> entry : entrySet) {

        final String key = entry.getKey();
        final String value = entry.getValue();

        if (!key.startsWith(prefix)) {
            continue;
        }//from ww w  .  j  av a 2s  .  com

        props.remove(key);

        try {

            final Field field = findField(klaz, key);

            field.set(instance, value);

            log.info("override : " + key + "=" + value);

        } catch (final Exception e) {

            log.warn("override : invalid stack param=" + key, e);

        }

    }

}

From source file:com.carrotgarden.maven.aws.util.Util.java

License:BSD License

public static void propsReport(final Log log, final String title, final Properties props) {

    log.info("properties : " + title);

    final Object[] keyArray = props.keySet().toArray();

    Arrays.sort(keyArray);/*from   w  ww .  jav a  2 s  .c  o  m*/

    for (final Object key : keyArray) {
        log.info("\t" + key + "=" + props.get(key));
    }

}

From source file:com.caucho.maven.MavenCopyTag.java

License:Open Source License

/**
 * Executes the maven resin:run task/*from   w w  w . j  a va 2  s.  c  om*/
 */
@Override
protected void doTask(WebAppDeployClient client) throws MojoExecutionException {
    Log log = getLog();

    CommitBuilder tag = null; //_tag;
    CommitBuilder sourceTag = null; // _sourceTag;

    if (tag == null)
        tag = buildVersionedWarTag();

    if (sourceTag == null) {
        sourceTag = new CommitBuilder();
        sourceTag.type("webapp");
        sourceTag.stage(_sourceStage);
        sourceTag.tagKey(_sourceVirtualHost + _sourceContextRoot);
        // _sourceVersion);
    }

    log.info("Copying " + sourceTag + " to " + tag);

    boolean result = client.copyTag(tag, sourceTag);

    if (!result)
        log.warn("Failed to copy " + sourceTag + " to " + tag);
}

From source file:com.caucho.maven.MavenDeleteTag.java

License:Open Source License

/**
 * Executes the maven resin:run task/*from  w  ww  .  j  a va  2 s  .  co m*/
 */
@Override
protected void doTask(WebAppDeployClient client) throws MojoExecutionException {
    Log log = getLog();

    CommitBuilder tag = null; // = _tag;

    if (tag == null)
        tag = buildVersionedWarTag();

    log.info("Deleting tag " + tag);

    if (!client.removeTag(tag))
        log.warn("Failed to delete tag " + tag);
}

From source file:com.caucho.maven.MavenQueryTags.java

License:Open Source License

/**
 * Executes the maven resin:run task/* w w w  .ja  va2  s .  c om*/
 */
@Override
protected void doTask(WebAppDeployClient client) throws MojoExecutionException {
    Log log = getLog();

    String pattern = _pattern;

    if (pattern == null) {
        if (getContextRoot() == null)
            setContextRoot(".*");

        CommitBuilder commit = buildVersionedWarTag();
        pattern = commit.getId();
    }

    log.debug("Query pattern = '" + pattern + "'");

    TagResult[] tags = client.queryTags(pattern);

    for (TagResult tag : tags) {
        if (_printValues)
            log.info(tag.getTag() + " -> " + tag.getRoot());
        else
            log.info(tag.getTag());
    }
}

From source file:com.caucho.maven.MavenUploadWar.java

License:Open Source License

/**
 * Executes the maven resin:run task/*ww  w . j  a va 2 s.c o m*/
 */
@Override
protected void doTask(WebAppDeployClient client) throws MojoExecutionException {
    Log log = getLog();

    try {
        // upload
        com.caucho.vfs.Path path = Vfs.lookup(_warFile);

        String archiveTag = _archive;

        if ("true".equals(archiveTag)) {
            archiveTag = client.createArchiveTag(getVirtualHost(), getContextRoot(), getVersion());
        } else if ("false".equals(archiveTag)) {
            archiveTag = null;
        }

        CommitBuilder commit = buildVersionedWarTag();

        client.commitArchive(commit, path);

        log.info("Deployed " + path + " to tag " + commit.getId());

        /*
        if (archiveTag != null) {
          client.copyTag(archiveTag, tag, attributes);
                
          log.info("Created archive tag " + archiveTag);
        }
                
        if (getVersion() != null && _writeHead) {
          String headTag = buildWarTag();
                
          client.copyTag(headTag, tag, attributes);
                
          log.info("Wrote head version tag " + headTag);
        }
        */
    } catch (Exception e) {
        throw new MojoExecutionException("Resin upload war failed", e);
    }
}