Example usage for com.fasterxml.jackson.core JsonProcessingException printStackTrace

List of usage examples for com.fasterxml.jackson.core JsonProcessingException printStackTrace

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonProcessingException printStackTrace.

Prototype

public void printStackTrace(PrintStream s) 

Source Link

Document

Prints this throwable and its backtrace to the specified print stream.

Usage

From source file:io.fabric8.devops.projects.finder.gogs.Main.java

public void run() {
    try {//from ww  w . ja  v a2s. co  m
        String host = Systems.getEnvVarOrSystemProperty("GOGS_SERVICE_HOST", "gogs.vagrant.f8");
        String port = Systems.getEnvVarOrSystemProperty("GOGS_SERVICE_PORT", "");
        address = "http://" + host + (Strings.isNotBlank(port) ? ":" + port : "");
        username = Systems.getEnvVarOrSystemProperty("JENKINS_GOGS_USER", "gogsadmin");
        password = Systems.getEnvVarOrSystemProperty("JENKINS_GOGS_PASSWORD", "RedHat$1");

        LOG.info("Logging into gogs at address: " + address + " with user " + username);

        GitRepoClient client = new GitRepoClient(address, username, password);
        List<RepositoryDTO> repos = client.listRepositories();
        System.out.println(JsonHelper.toJson(repos));
    } catch (JsonProcessingException e) {
        System.err.println("Failed to find repos: " + e);
        e.printStackTrace(System.err);
    }
}