Skip to content

Commit

Permalink
openjdk11
Browse files Browse the repository at this point in the history
  • Loading branch information
bochkov committed Apr 21, 2019
1 parent a779225 commit ca1c637
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
language: java

jdk:
- openjdk11

before_install:
- echo "artifactory_contextUrl=${AR_URL}" >> ~/.gradle/gradle.properties
- echo "artifactory_user=${AR_USER}" >> ~/.gradle/gradle.properties
Expand Down
35 changes: 12 additions & 23 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,47 +1,36 @@
plugins {
id 'com.jfrog.artifactory' version '4.9.3'
id 'com.jfrog.artifactory' version '4.9.5'
}

group = 'cordelia'
version = '1.2.8.RELEASE'
version = '1.3.0.RELEASE'

apply plugin: 'java'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'maven-publish'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility = 11
targetCompatibility = 11

repositories {
jcenter()
}

dependencies {
// GSON and HttpClient
compile group: 'org.cactoos', name: 'cactoos', version: '0.40'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile group: 'com.jcabi', name: 'jcabi-http', version: '1.17.2'
compile group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
compile group: 'com.sun.jersey', name: 'jersey-client', version: '1.19'
//compile group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.2.11'
//compile group: 'com.sun.xml.bind', name: 'jaxb-impl', version:'2.2.11'
//compile group: 'javax.activation', name: 'activation', version: '1.1.1'

// Logging
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'

// Test
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'com.sun.grizzly', name: 'grizzly-servlet-webserver', version: '1.9.65'
implementation('org.cactoos:cactoos:0.40')
implementation('com.google.code.gson:gson:2.8.5')
implementation('com.jcabi:jcabi-http:1.17.2')
implementation('javax.json:javax.json-api:1.1.4')

testImplementation('junit:junit:4.12')
testImplementation('com.sun.grizzly:grizzly-servlet-webserver:1.9.65')
}

artifactory {
contextUrl = "${artifactory_contextUrl}"
publish {
defaults {
publications ('mavenJava')
publications('mavenJava')
}
repository {
repoKey = 'libs-release-local'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 3 additions & 2 deletions src/main/java/cordelia/client/GsonResponse.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package cordelia.client;

import com.google.gson.Gson;
import com.jcabi.http.Request;
import com.jcabi.http.Response;

import java.util.List;
import java.util.Map;

import static cordelia.client.TrClient.GSON;

public final class GsonResponse implements Response {

private final Response origin;
Expand Down Expand Up @@ -51,6 +52,6 @@ public <T extends Response> T as(Class<T> type) {
}

public <T> T json(Class<T> type) {
return new Gson().fromJson(body(), type);
return GSON.fromJson(body(), type);
}
}
5 changes: 4 additions & 1 deletion src/main/java/cordelia/client/TrClient.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cordelia.client;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.jcabi.http.Request;
import com.jcabi.http.Response;
import com.jcabi.http.request.JdkRequest;
Expand All @@ -15,6 +16,8 @@

public final class TrClient implements Client {

public static final Gson GSON = new GsonBuilder().create();

private final URI uri;
private final List<Session> cachedSession = new ArrayList<>();

Expand Down Expand Up @@ -57,7 +60,7 @@ private Response baseReponse(Serializable serializable) throws IOException {
.through(Retry409Wire.class)
.through(RetryWire.class)
.body()
.set(new Gson().toJson(serializable))
.set(GSON.toJson(serializable))
.back()
.fetch();
}
Expand Down

0 comments on commit ca1c637

Please sign in to comment.