Skip to content

Commit

Permalink
[Java][webclient] fix missing dependencies in build.gradle (#7777)
Browse files Browse the repository at this point in the history
* fix build.gradle in java webclient

* update junit version in samples
  • Loading branch information
wing328 authored Oct 21, 2020
1 parent ee3dd70 commit e09d1be
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
apply plugin: 'idea'
apply plugin: 'eclipse'

group = '{{groupId}}'
version = '{{artifactVersion}}'

buildscript {
repositories {
maven { url "https://repo1.maven.org/maven2" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}

repositories {
maven { url "https://repo1.maven.org/maven2" }
jcenter()
}

if(hasProperty('target') && target == 'android') {
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 14
targetSdkVersion 25
}

compileOptions {
{{#supportJava6}}
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
{{/supportJava6}}
{{^supportJava6}}
{{#java8}}
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
{{/java8}}
{{^java8}}
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
{{/java8}}
{{/supportJava6}}
}

// Rename the aar correctly
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}

dependencies {
provided 'javax.annotation:jsr250-api:1.0'
}
}

afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
artifacts.add('archives', task);
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}

artifacts {
archives sourcesJar
}

} else {
apply plugin: 'java'
apply plugin: 'maven'
{{#supportJava6}}
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
{{/supportJava6}}
{{^supportJava6}}
{{#java8}}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
{{/java8}}
{{^java8}}
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
{{/java8}}
{{/supportJava6}}

install {
repositories.mavenInstaller {
pom.artifactId = '{{artifactId}}'
}
}

task execute(type:JavaExec) {
main = System.getProperty('mainClass')
classpath = sourceSets.main.runtimeClasspath
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar
archives javadocJar
}
}

ext {
swagger_annotations_version = "1.6.2"
spring_web_version = "5.0.16.RELEASE"
jackson_version = "2.11.3"
jackson_databind_version = "2.11.3"
{{#openApiNullable}}
jackson_databind_nullable_version = "0.2.1"
{{/openApiNullable}}
javax_annotation_version = "1.3.2"
reactor_version = "3.3.10.RELEASE"
reactor_netty_version = "0.7.15.RELEASE"
jodatime_version = "2.9.9"
junit_version = "4.13.1"
}

dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.findbugs:jsr305:3.0.2"
compile "io.projectreactor:reactor-core:$reactor_version"
compile "org.springframework:spring-webflux:$spring_web_version"
compile "io.projectreactor.ipc:reactor-netty:$reactor_netty_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_databind_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
{{#openApiNullable}}
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
{{/openApiNullable}}
{{#joda}}
compile "joda-time:joda-time:$jodatime_version"
{{/joda}}
{{#java8}}
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
{{/java8}}
{{^java8}}
compile "com.brsanthu:migbase64:2.2"
{{/java8}}
compile "javax.annotation:javax.annotation-api:$javax_annotation_version"
testCompile "junit:junit:$junit_version"
}

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -114,23 +113,23 @@
{{/openApiNullable}}

{{#java8}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
{{/java8}}
{{#joda}}
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime-version}</version>
</dependency>
{{/joda}}
<dependency>
<groupId>javax.annotation</groupId>
Expand All @@ -149,15 +148,17 @@
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.22</swagger-annotations-version>
<swagger-annotations-version>1.6.2</swagger-annotations-version>
<spring-web-version>5.0.16.RELEASE</spring-web-version>
<jackson-version>2.10.3</jackson-version>
<jackson-databind-version>2.10.3</jackson-databind-version>
<jackson-version>2.11.3</jackson-version>
<jackson-databind-version>2.11.3</jackson-databind-version>
{{#openApiNullable}}
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
{{/openApiNullable}}
<javax-annotation-version>1.3.2</javax-annotation-version>
<junit-version>4.13.1</junit-version>
<reactor-version>3.1.8.RELEASE</reactor-version>
<reactor-netty-version>0.7.8.RELEASE</reactor-netty-version>
<reactor-version>3.3.10.RELEASE</reactor-version>
<reactor-netty-version>0.7.15.RELEASE</reactor-netty-version>
{{#joda}}
<jodatime-version>2.9.9</jodatime-version>
{{/joda}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,6 @@
{{/threetenbp}}
<javax-annotation-version>1.3.2</javax-annotation-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13</junit-version>
<junit-version>4.13.1</junit-version>
</properties>
</project>
2 changes: 1 addition & 1 deletion samples/client/petstore/java/jersey1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,6 @@
<jackson-threetenbp-version>2.9.10</jackson-threetenbp-version>
<javax-annotation-version>1.3.2</javax-annotation-version>
<maven-plugin-version>1.0.0</maven-plugin-version>
<junit-version>4.13</junit-version>
<junit-version>4.13.1</junit-version>
</properties>
</project>
18 changes: 11 additions & 7 deletions samples/client/petstore/java/webclient/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,31 @@ if(hasProperty('target') && target == 'android') {
}

ext {
swagger_annotations_version = "1.5.22"
jackson_version = "2.10.3"
jackson_databind_version = "2.10.4"
swagger_annotations_version = "1.6.2"
spring_web_version = "5.0.16.RELEASE"
jackson_version = "2.11.3"
jackson_databind_version = "2.11.3"
jackson_databind_nullable_version = "0.2.1"
jersey_version = "1.19.4"
javax_annotation_version = "1.3.2"
reactor_version = "3.3.10.RELEASE"
reactor_netty_version = "0.7.15.RELEASE"
jodatime_version = "2.9.9"
junit_version = "4.13.1"
}

dependencies {
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
compile "com.google.code.findbugs:jsr305:3.0.2"
compile "com.sun.jersey:jersey-client:$jersey_version"
compile "com.sun.jersey.contribs:jersey-multipart:$jersey_version"
compile "io.projectreactor:reactor-core:$reactor_version"
compile "org.springframework:spring-webflux:$spring_web_version"
compile "io.projectreactor.ipc:reactor-netty:$reactor_netty_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_databind_version"
compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version"
compile "org.openapitools:jackson-databind-nullable:$jackson_databind_nullable_version"
compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version"
compile 'javax.annotation:javax.annotation-api:1.3.2'
compile "javax.annotation:javax.annotation-api:$javax_annotation_version"
testCompile "junit:junit:$junit_version"
}

21 changes: 10 additions & 11 deletions samples/client/petstore/java/webclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

<build>
<plugins>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -104,11 +103,11 @@
<version>${jackson-databind-nullable-version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand All @@ -126,14 +125,14 @@
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations-version>1.5.22</swagger-annotations-version>
<swagger-annotations-version>1.6.2</swagger-annotations-version>
<spring-web-version>5.0.16.RELEASE</spring-web-version>
<jackson-version>2.10.3</jackson-version>
<jackson-databind-version>2.10.3</jackson-databind-version>
<jackson-version>2.11.3</jackson-version>
<jackson-databind-version>2.11.3</jackson-databind-version>
<jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
<javax-annotation-version>1.3.2</javax-annotation-version>
<junit-version>4.13.1</junit-version>
<reactor-version>3.1.8.RELEASE</reactor-version>
<reactor-netty-version>0.7.8.RELEASE</reactor-netty-version>
<reactor-version>3.3.10.RELEASE</reactor-version>
<reactor-netty-version>0.7.15.RELEASE</reactor-netty-version>
</properties>
</project>

0 comments on commit e09d1be

Please sign in to comment.