diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index 5f5376f2861..a64f33174da 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -71,7 +71,7 @@ public class ApiClient { objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); {{#java8}} - objectMapper.registerModule(new JSR310Module()); + objectMapper.registerModule(new JavaTimeModule()); {{/java8}} {{^java8}} objectMapper.registerModule(new JodaModule()); diff --git a/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache index 9920a371e5d..c969c9f7b08 100644 --- a/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache @@ -32,8 +32,14 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 23 } compileOptions { + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} } // Rename the aar correctly @@ -77,9 +83,15 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - + + {{#java8}} + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + {{/java8}} install { repositories.mavenInstaller { @@ -95,9 +107,9 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.7.0" + jackson_version = "2.7.5" jersey_version = "1.19.1" - jodatime_version = "2.9.3" + jodatime_version = "2.9.4" junit_version = "4.12" } @@ -109,8 +121,13 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" - compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.1.5" + {{#java8}} + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + {{/java8}} + {{^java8}} + compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "joda-time:joda-time:$jodatime_version" + {{/java8}} compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache index 7d9a9732862..243e444cf01 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/JSON.mustache @@ -25,7 +25,7 @@ public class JSON implements ContextResolver { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); {{#java8}} - mapper.registerModule(new JSR310Module()); + mapper.registerModule(new JavaTimeModule()); {{/java8}} {{^java8}} mapper.registerModule(new JodaModule()); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index b17cd34e420..285b35a32a4 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -106,10 +106,10 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.7.0" + jackson_version = "2.7.5" jersey_version = "2.22.2" {{^java8}} - jodatime_version = "2.9.3" + jodatime_version = "2.9.4" {{/java8}} junit_version = "4.12" } @@ -118,7 +118,7 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.glassfish.jersey.core:jersey-client:$jersey_version" compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" - compile "org.glassfish.jersey.media:jersey-media-json-jackson:2.22.1" + compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" @@ -126,7 +126,7 @@ dependencies { compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" {{/java8}} {{^java8}} - compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.1.5" + compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "joda-time:joda-time:$jodatime_version" {{/java8}} compile "com.brsanthu:migbase64:2.2" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 46ff84d1e72..c43d6a0375c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -12,16 +12,16 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.8", "org.glassfish.jersey.core" % "jersey-client" % "2.22.2", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2", - "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.7.0", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.0", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.0", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2", + "com.fasterxml.jackson.core" % "jackson-core" % "2.7.5", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5", {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.7.0", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.7.5", {{/java8}} {{^java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.1.5", - "joda-time" % "joda-time" % "2.9.3", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5", + "joda-time" % "joda-time" % "2.9.4", {{/java8}} "com.brsanthu" % "migbase64" % "2.2", "junit" % "junit" % "4.12" % "test", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index d6b51a2f884..ee55337e4b9 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -52,7 +52,7 @@ org.apache.maven.plugins maven-jar-plugin - 2.2 + 2.6 @@ -98,7 +98,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 2.5.1 {{#java8}} 1.8 @@ -133,7 +133,7 @@ org.glassfish.jersey.media jersey-media-json-jackson - 2.22.1 + ${jersey-version} @@ -163,7 +163,7 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.1.5 + ${jackson-version} joda-time @@ -190,9 +190,9 @@ 1.5.8 2.22.2 - 2.7.0 + 2.7.5 {{^java8}} - 2.9.3 + 2.9.4 {{/java8}} 1.0.0 4.12 diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index 3a8c440eaee..95712934525 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -160,7 +160,7 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.1.5 + ${jackson-version} joda-time @@ -188,9 +188,9 @@ UTF-8 1.5.8 1.19.1 - 2.7.0 + 2.7.5 {{^java8}} - 2.9.3 + 2.9.4 {{/java8}} 1.0.0 4.12