File tree Expand file tree Collapse file tree 9 files changed +62
-52
lines changed
spring-boot-examples/spring-boot-dubbo3
spring-boot-dubbo3-consumer
spring-boot-dubbo3-provider Expand file tree Collapse file tree 9 files changed +62
-52
lines changed Original file line number Diff line number Diff line change @@ -36,8 +36,7 @@ allprojects {
36
36
set(" springBootVersion" , " 2.7.4" )
37
37
set(" springCloudVersion" , " Hoxton.SR10" )
38
38
set(" springCloudAlibabaVersion" , " 2.2.6.RELEASE" )
39
- set(" grpcVersion" , " 1.39.0" )
40
- set(" protocVersion" , " 3.17.2" )
39
+
41
40
}
42
41
43
42
@@ -47,15 +46,6 @@ allprojects {
47
46
// mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
48
47
// mavenBom "com.alibaba.cloud:spring-cloud-alibaba-dependencies:${springCloudAlibabaVersion}"
49
48
}
50
- dependencies {
51
- // grpc
52
- dependency " io.grpc:grpc-protobuf:${ grpcVersion} "
53
- dependency " io.grpc:grpc-stub:${ grpcVersion} "
54
- dependency " io.grpc:grpc-netty-shaded:${ grpcVersion} "
55
- dependency " io.grpc:grpc-core:${ grpcVersion} " // spring 依赖管理中定义了,需要重新声明
56
- dependency " io.grpc:grpc-api:${ grpcVersion} " // spring 依赖管理中定义了,需要重新声明
57
-
58
- }
59
49
}
60
50
61
51
dependencies {
Original file line number Diff line number Diff line change 1
- plugins {
2
- id " com.google.protobuf" version " 0.8.16"
3
- id " org.springframework.boot"
1
+ dependencyManagement {
2
+ imports {
3
+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ springBootVersion} "
4
+ }
4
5
}
5
6
6
-
7
-
8
-
9
7
dependencies {
10
- // grpc
11
- implementation " io.grpc:grpc-protobuf"
12
- implementation " io.grpc:grpc-stub"
13
- runtimeOnly " io.grpc:grpc-netty-shaded"
14
-
15
- api(" org.springframework.boot:spring-boot-starter-web" )
16
- implementation " com.squareup.okhttp3:okhttp"
17
- implementation " com.github.ben-manes.caffeine:caffeine"
18
-
19
- api(" org.springframework.boot:spring-boot-starter-actuator" )
20
- }
8
+ api(" com.google.protobuf:protobuf-java:3.11.0" )
21
9
22
-
23
- protobuf {
24
- protoc { artifact = " com.google.protobuf:protoc:${ protocVersion} " }
25
- plugins {
26
- grpc { artifact = " io.grpc:protoc-gen-grpc-java:${ grpcVersion} " }
27
- }
28
- generateProtoTasks {
29
- all()* . plugins { grpc {} }
30
- }
31
- }
32
-
33
- // Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
34
- sourceSets {
35
- main {
36
- java {
37
- srcDirs " build/generated/source/proto/main/grpc"
38
- srcDirs " build/generated/source/proto/main/java"
39
- }
40
- }
10
+ testImplementation(" org.springframework.boot:spring-boot-starter-test" )
41
11
}
Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ include "spring-boot-pulsar"
51
51
52
52
include " spring-boot-methodHandler"
53
53
54
+ include " spring-boot-grpc"
55
+
54
56
// spring boot examples
55
57
include " spring-boot-examples:spring-boot-redis"
56
- include " spring-boot-examples:spring-boot-pulsar"
57
58
include " spring-boot-examples:spring-boot-webmvc"
58
59
include " spring-boot-examples:spring-boot-dubbo3:spring-boot-dubbo3-consumer"
59
60
include " spring-boot-examples:spring-boot-dubbo3:spring-boot-dubbo3-provider"
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ plugins {
3
3
}
4
4
5
5
ext {
6
- DUBBO_VERSION = " 3.0.5"
6
+ set(" DUBBO_VERSION" , " 3.0.5" )
7
+ set(" protocVersion" , " 3.17.2" )
7
8
}
8
9
9
10
protobuf {
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ plugins {
3
3
}
4
4
5
5
ext {
6
- DUBBO_VERSION = " 3.0.5"
6
+ set(" DUBBO_VERSION" , " 3.0.5" )
7
+ set(" protocVersion" , " 3.17.2" )
7
8
}
8
9
9
10
protobuf {
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id " com.google.protobuf" version " 0.8.16"
3
+ }
4
+
5
+ ext {
6
+ set(" grpcVersion" , " 1.39.0" )
7
+ set(" protocVersion" , " 3.17.2" )
8
+ }
9
+
10
+
11
+ dependencyManagement {
12
+ imports {
13
+ mavenBom " org.springframework.boot:spring-boot-dependencies:${ springBootVersion} "
14
+ }
15
+ }
16
+
17
+ dependencies {
18
+ // grpc
19
+ implementation " io.grpc:grpc-protobuf:${ grpcVersion} "
20
+ implementation " io.grpc:grpc-stub:${ grpcVersion} "
21
+ runtimeOnly " io.grpc:grpc-netty-shaded:${ grpcVersion} "
22
+
23
+ api(" org.springframework.boot:spring-boot-starter-web" )
24
+
25
+ testImplementation(" org.springframework.boot:spring-boot-starter-test" )
26
+ }
27
+
28
+
29
+ protobuf {
30
+ protoc { artifact = " com.google.protobuf:protoc:${ protocVersion} " }
31
+ plugins {
32
+ grpc { artifact = " io.grpc:protoc-gen-grpc-java:${ grpcVersion} " }
33
+ }
34
+ generateProtoTasks {
35
+ all()* . plugins { grpc {} }
36
+ }
37
+ }
38
+
39
+ // Inform IDEs like IntelliJ IDEA, Eclipse or NetBeans about the generated code.
40
+ sourceSets {
41
+ main {
42
+ java {
43
+ srcDirs " src/main/proto"
44
+ srcDirs " build/generated/source/proto/main/grpc"
45
+ srcDirs " build/generated/source/proto/main/java"
46
+ }
47
+ }
48
+ }
Original file line number Diff line number Diff line change 5
5
import com .ooooo .grpc .helloworld .HelloRequest ;
6
6
import io .grpc .ManagedChannel ;
7
7
import io .grpc .ManagedChannelBuilder ;
8
- import lombok .SneakyThrows ;
9
-
10
8
import java .util .concurrent .TimeUnit ;
9
+ import lombok .SneakyThrows ;
11
10
12
11
/**
13
12
* @author ooooo
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments