Skip to content

Commit e9d4a4f

Browse files
committed
chore: upgrade versions - remove stale deps
1 parent ecf3911 commit e9d4a4f

5 files changed

Lines changed: 41 additions & 30 deletions

File tree

build.gradle

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1+
plugins {
2+
id 'java'
3+
id 'groovy'
4+
id 'idea'
5+
id 'eclipse'
6+
}
7+
18
group = 'com.veem'
29
version = '1.0'
310

4-
apply plugin: 'java'
5-
apply plugin: 'groovy'
6-
apply plugin: 'idea'
7-
apply plugin: 'eclipse'
8-
9-
sourceCompatibility = 1.8
10-
targetCompatibility = 1.8
11-
1211
repositories {
1312
mavenCentral()
1413
}
@@ -17,25 +16,38 @@ configurations {
1716
extraLibs
1817
}
1918

19+
java {
20+
sourceCompatibility = JavaVersion.VERSION_17
21+
targetCompatibility = JavaVersion.VERSION_17
22+
}
23+
2024
dependencies {
21-
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.8',
22-
'com.googlecode.json-simple:json-simple:1.1.1',
23-
'com.squareup.retrofit2:retrofit:2.2.0',
24-
'com.squareup.retrofit2:converter-jackson:2.2.0',
25-
'com.squareup.okhttp3:logging-interceptor:3.12.0',
26-
'com.neovisionaries:nv-i18n:1.21',
27-
'org.projectlombok:lombok:1.18.4',
28-
'org.slf4j:slf4j-api:1.7.25'
29-
testCompile 'org.spockframework:spock-core:1.2-groovy-2.5'
25+
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.1'
26+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
27+
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
28+
implementation 'com.squareup.retrofit2:converter-jackson:2.9.0'
29+
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
30+
implementation 'com.neovisionaries:nv-i18n:1.29'
31+
implementation 'org.slf4j:slf4j-api:2.0.12'
32+
33+
compileOnly 'org.projectlombok:lombok:1.18.30'
34+
annotationProcessor 'org.projectlombok:lombok:1.18.30'
35+
36+
testCompileOnly 'org.projectlombok:lombok:1.18.30'
37+
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
38+
39+
testImplementation 'org.apache.groovy:groovy-json:4.0.19'
40+
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
3041
}
3142

32-
task copyExtraLibs(type: Copy) {
43+
tasks.register('copyExtraLibs', Copy) {
3344
from configurations.extraLibs
34-
into tasks.jar.destinationDir
45+
into tasks.jar.destinationDirectory
3546
}
3647

3748
jar {
38-
from configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
49+
from configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
3950
exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF', 'org/junit/**', 'junit'
51+
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
4052

4153
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip

src/main/java/com/veem/client/AttachmentClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public Attachment download(final Attachment attachment, final Path targetDirecto
7979
val targetFilePath = targetDirectory.toAbsolutePath().resolve(attachment.getName());
8080
if (Files.exists(targetFilePath))
8181
{
82-
throw new VeemSdkException(String.format("%s already exists", targetFilePath.toString()));
82+
throw new VeemSdkException(String.format("%s already exists", targetFilePath));
8383
}
8484
val responseBody = handleResponse(attachmentApi.download(
8585
attachment.getName(), attachment.getReferenceId(), veemClient.authorization)::execute);
@@ -93,14 +93,14 @@ private static void prepareDirectory(final Path targetDirectory) throws VeemExce
9393
{
9494
if (!Files.isDirectory(targetDirectory))
9595
{
96-
throw new VeemSdkException(String.format("%s is not a directory", targetDirectory.toString()));
96+
throw new VeemSdkException(String.format("%s is not a directory", targetDirectory));
9797
}
9898
}
9999
else
100100
{
101101
if (!targetDirectory.toFile().mkdirs())
102102
{
103-
throw new VeemSdkException(String.format("Unable to create director %s", targetDirectory.toString()));
103+
throw new VeemSdkException(String.format("Unable to create director %s", targetDirectory));
104104
}
105105
}
106106
}
@@ -114,7 +114,7 @@ private static void writeFile(final Path targetFilePath, final ResponseBody resp
114114
catch (IOException e)
115115
{
116116
throw new VeemSdkException(e, String.format("The downloaded file could not be saved to %s",
117-
targetFilePath.toString()));
117+
targetFilePath));
118118
}
119119
}
120120
}

src/main/java/com/veem/client/ResponseHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import static java.util.Optional.ofNullable;
44

5+
import com.fasterxml.jackson.databind.JsonNode;
56
import com.fasterxml.jackson.databind.ObjectMapper;
67
import com.veem.exceptions.VeemBadRequestException;
78
import com.veem.exceptions.VeemConflictException;
@@ -14,8 +15,6 @@
1415
import com.veem.exceptions.VeemUnauthorizedException;
1516
import lombok.extern.slf4j.Slf4j;
1617
import lombok.val;
17-
import org.json.simple.JSONObject;
18-
import org.json.simple.JSONValue;
1918
import retrofit2.Response;
2019

2120
import java.io.IOException;
@@ -114,10 +113,10 @@ private static String extractError(final Response<?> response, final String erro
114113
String error;
115114
try
116115
{
117-
val errorResponse = (JSONObject) JSONValue.parse(errorBody);
116+
val errorResponse = MAPPER.readTree(errorBody);
118117
error = ofNullable(errorResponse)
119118
.map(er -> er.get("message"))
120-
.map(Object::toString)
119+
.map(JsonNode::asText)
121120
.orElseThrow(RuntimeException::new);
122121
log.error(error);
123122
}

src/main/java/com/veem/exceptions/VeemErrorResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import lombok.NoArgsConstructor;
88
import lombok.Setter;
99

10-
import javax.xml.bind.annotation.XmlRootElement;
10+
import jakarta.xml.bind.annotation.XmlRootElement;
1111
import java.util.Date;
1212

1313
/**

0 commit comments

Comments
 (0)