use of com.atlassian.jira.rest.client.api.domain.ServerInfo in project opennms by OpenNMS.
the class VerifyCommand method verifyConnection.
private JiraRestClient verifyConnection() {
final String host = config.getHost();
final String username = config.getUsername();
final String password = config.getPassword();
try {
System.out.println();
System.out.println("Try connecting to jira server " + host + " with username: '" + username + "' and password: '" + password + "'...");
final JiraRestClient connection = JiraConnectionFactory.createConnection(host, username, password);
final ServerInfo serverInfo = connection.getMetadataClient().getServerInfo().get();
System.out.println("Successfully connected to jira instance at " + host);
System.out.println("Server Info:" + serverInfo.toString());
System.out.println("OK");
return connection;
} catch (PluginException | InterruptedException | ExecutionException e) {
throw new RuntimeException("Could not connect to jira server", e);
}
}
Aggregations