Skip to content

Commit

Permalink
移除oki直接依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
chentianming11 committed Sep 6, 2022
1 parent 1b4b349 commit 5bd5443
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 85 deletions.
40 changes: 3 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,45 +49,11 @@ gitee项目地址:[https://gitee.com/lianjiatech/retrofit-spring-boot-starter]
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.6</version>
<version>2.3.7</version>
</dependency>
```

**本项目依赖Retrofit-2.9.0,okhttp-3.14.9,okio-1.17.5版本,如果启动失败,可尝试手动引入完整依赖**


```xml
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.6</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.14.9</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.9</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.17.5</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>2.9.0</version>
</dependency>
```
**如果启动失败,大概率是依赖冲突,烦请引入或者排除相关依赖**

### 定义HTTP接口

Expand Down Expand Up @@ -144,7 +110,7 @@ public class TestService {

组件支持了多个可配置的属性,用来应对不同的业务场景,具体可支持的配置属性及默认值如下:

**注意:应用只需要配置要更改的配置项**
**注意:应用只需要配置要更改的配置项**!

```yaml
retrofit:
Expand Down
37 changes: 1 addition & 36 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,7 @@
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.6</version>
</dependency>
```

**This project depends on Retrofit-2.9.0, okhttp-3.14.9, and okio-1.17.5 versions. If the startup fails, you can try to manually introduce complete dependencies**

```xml
<dependency>
<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.6</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.14.9</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.14.9</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>1.17.5</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-jackson</artifactId>
<version>2.9.0</version>
<version>2.3.7</version>
</dependency>
```

Expand Down
File renamed without changes
16 changes: 5 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.lianjiatech</groupId>
<artifactId>retrofit-spring-boot-starter</artifactId>
<version>2.3.6</version>
<version>2.3.7</version>

<name>retrofit-spring-boot-starter</name>
<description>retrofit-spring-boot-starter</description>
Expand Down Expand Up @@ -42,8 +42,7 @@
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<slf4j-api.version>1.7.25</slf4j-api.version>
<spring-boot.version>2.0.9.RELEASE</spring-boot.version>
<okhttp3.version>3.14.9</okhttp3.version>
<okio.version>1.17.5</okio.version>
<okhttp.version>3.14.9</okhttp.version>
<sentinel.version>1.6.3</sentinel.version>
<jackson.version>2.12.6.1</jackson.version>
<lombok.version>1.18.24</lombok.version>
Expand Down Expand Up @@ -130,17 +129,17 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>${okhttp3.version}</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp3.version}</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>${okhttp3.version}</version>
<version>${okhttp.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -155,11 +154,6 @@
<version>${retrofit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>${okio.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public RetrofitFactoryBean(Class<T> retrofitInterface) {
}

@Override
public T getObject() throws Exception {
public T getObject() {
T source = createRetrofit().create(retrofitInterface);
if (!isEnableDegrade(retrofitInterface)) {
return source;
Expand Down

0 comments on commit 5bd5443

Please sign in to comment.