diff --git a/backup-commons/build.gradle b/backup-commons/build.gradle index f30e787..acb5d83 100644 --- a/backup-commons/build.gradle +++ b/backup-commons/build.gradle @@ -4,8 +4,8 @@ apply plugin: 'maven' group 'com.opsgenie.tools' version '0.23.8' -sourceCompatibility = 1.6 -targetCompatibility = 1.6 +sourceCompatibility = 1.8 +targetCompatibility = 1.8 repositories { mavenLocal() @@ -17,11 +17,16 @@ apply plugin: 'java' apply plugin: 'project-report' dependencies { - compile 'org.apache.logging.log4j:log4j-api:2.16.0' - compile 'org.apache.logging.log4j:log4j-core:2.16.0' - compile "org.apache.logging.log4j:log4j-slf4j-impl:2.16.0" + compile 'org.apache.logging.log4j:log4j-api:2.17.2' + compile 'org.apache.logging.log4j:log4j-core:2.17.2' + compile "org.apache.logging.log4j:log4j-slf4j-impl:2.17.2" compile "com.beust:jcommander:1.48" - compile 'org.eclipse.jgit:org.eclipse.jgit:4.5.0.201609210915-r' + compile 'org.apache.httpcomponents:httpclient:4.5.13' + compile 'org.apache.httpcomponents:httpcore:4.4.15' + //compile 'com.jcraft:jsch:0.1.55' + compile 'org.eclipse.jgit:org.eclipse.jgit:5.13.0.202109080827-r' + compile 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache:5.13.0.202109080827-r' + compile 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:5.13.0.202109080827-r' compile "com.opsgenie.oas:opsgenie-sdk-swagger:1.0.12" compile ('com.fasterxml.jackson.core:jackson-databind:2.10.4') { force = true diff --git a/backup-commons/src/main/java/com/opsgenie/tools/backup/BaseBackup.java b/backup-commons/src/main/java/com/opsgenie/tools/backup/BaseBackup.java index fdbfa09..51fc24a 100644 --- a/backup-commons/src/main/java/com/opsgenie/tools/backup/BaseBackup.java +++ b/backup-commons/src/main/java/com/opsgenie/tools/backup/BaseBackup.java @@ -17,6 +17,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.eclipse.jgit.transport.JschConfigSessionFactory; +import org.eclipse.jgit.transport.OpenSshConfig; +import org.eclipse.jgit.transport.CredentialsProviderUserInfo; + import java.io.File; import java.io.FileNotFoundException; import java.io.UnsupportedEncodingException; diff --git a/backup-commons/src/main/java/com/opsgenie/tools/backup/retry/RateLimitManager.java b/backup-commons/src/main/java/com/opsgenie/tools/backup/retry/RateLimitManager.java index 276b6eb..3808ec2 100644 --- a/backup-commons/src/main/java/com/opsgenie/tools/backup/retry/RateLimitManager.java +++ b/backup-commons/src/main/java/com/opsgenie/tools/backup/retry/RateLimitManager.java @@ -26,7 +26,7 @@ private int getApiLimitForDomain(DomainNames domain, int periodInSeconds) { resultLimit = domainLimitDto.getLimit(); } } - return resultLimit; + return Math.max(resultLimit, 1); } public int getRateLimit(DomainNames domain, int period) { diff --git a/backup-commons/src/main/java/com/opsgenie/tools/backup/util/BackupUtils.java b/backup-commons/src/main/java/com/opsgenie/tools/backup/util/BackupUtils.java index abd26b3..f861536 100644 --- a/backup-commons/src/main/java/com/opsgenie/tools/backup/util/BackupUtils.java +++ b/backup-commons/src/main/java/com/opsgenie/tools/backup/util/BackupUtils.java @@ -49,7 +49,7 @@ public static String readFile(String fileName) throws IOException { public static RateLimitsDto generateRateLimits(String apiKey, String opsGenieHost) throws IOException { try { - HttpClient client = HttpClientBuilder.create().build(); + HttpClient client = HttpClientBuilder.create().useSystemProperties().build(); HttpGet httpGet = new HttpGet(opsGenieHost + "/v2/request-limits/"); httpGet.addHeader(HttpHeaders.AUTHORIZATION, "GenieKey " + apiKey); diff --git a/backup-export/build.gradle b/backup-export/build.gradle index db71d60..670c678 100644 --- a/backup-export/build.gradle +++ b/backup-export/build.gradle @@ -3,7 +3,7 @@ version '0.23.8' apply plugin: 'java' -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 dependencies { compile project(':backup-commons') diff --git a/backup-import/build.gradle b/backup-import/build.gradle index 2110fc7..1a3281a 100644 --- a/backup-import/build.gradle +++ b/backup-import/build.gradle @@ -3,7 +3,7 @@ version '0.23.8' apply plugin: 'java' -sourceCompatibility = 1.6 +sourceCompatibility = 1.8 dependencies { compile project(':backup-commons') diff --git a/build.gradle b/build.gradle index d7d2212..0d89eba 100755 --- a/build.gradle +++ b/build.gradle @@ -4,8 +4,8 @@ apply plugin: 'maven' group 'com.opsgenie.tools' version '0.23.8' -sourceCompatibility = 1.6 -targetCompatibility = 1.6 +sourceCompatibility = 1.8 +targetCompatibility = 1.8 repositories { mavenLocal() diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f23c24e..038335a 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip