Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

移除client侧guava库 #4457

Closed
cjdxhjj opened this issue Jul 13, 2022 · 25 comments
Closed

移除client侧guava库 #4457

cjdxhjj opened this issue Jul 13, 2022 · 25 comments
Labels

Comments

@cjdxhjj
Copy link

cjdxhjj commented Jul 13, 2022

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
目前多个组件依赖了不同的版本的guava库,升级时爆出xx类不存在,之前的库无法更新升级,如zk的curator,这个和zk版本强绑定,dubbo又依赖zk,系统中很多dubbo服务,根本不可能升级

Describe the solution you'd like
A clear and concise description of what you want to happen.
移除guava等高频依赖
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@hezhangjian
Copy link
Member

can you just update guava library version to latest?

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

can't startup due to the no class def found error

@hezhangjian
Copy link
Member

@cjdxhjj could please share the detail error msg or your depnendecy tree? :)

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

dep tree.txt
yes

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

error report.txt
the startup error is here

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

image

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

因为此类问题,spring 早就淘汰使用guava,但是其它库还在大量使用,目前我这个项目里就有16,20, 29
apollo 2.0.0依赖 31.0.1这么大的版本跨度下,每次更新依赖都是如履薄冰,一不小心就启动不了

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

image

@hezhangjian
Copy link
Member

Sorry for my late reply, I don't think spring remove guava for this reason, could you prove that? Spring update many dependencies frequently. Like bytebuddy/netty/prometheus-client.
Since you can't update guava dependency now. I suggest you shade apollo-client for now[1]. See https://www.jianshu.com/p/8171607ce03f

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

image

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

我觉得如果你们必需要用,应该使用你提供的方式将它嵌入在apollo的包中,并改包名,这样不会对其它包造成影响

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

那个包的api不兼容变更很常见,发布的也比较频繁

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

我觉得客户端根本不需要guice,一共没几个类,基本也就一个实现

@hezhangjian
Copy link
Member

community has been discussed it before. you can share your feature request on #4369
If you are in a hurry, you can manually shade apollo package yourself.

cc @nobodyiam

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

目前我是使用方(有冲突),如果要从我这个地方解决的话,我需要重新打包apollo-client以应用shade插件

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 13, 2022

感觉还是解决掉这个麻烦(依赖)才是好的解决方案,目前jdk升级后,好多guava里的东西其实没啥价值了,远不如cats, zio, vavr,arrow-core等库方便好用

@nobodyiam
Copy link
Member

This is an interesting topic to discuss. Apollo now requires guava 20.0+, can you upgrade to this version?
#4369 discusses the pros and cons of shading guava into apollo-client, and I think this may be the ultimate solution.

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 14, 2022

实际上我没看到是什么配置让guava降到16
image
image

@nobodyiam
Copy link
Member

You could declare the guava version in the dependencyManagement section of your project's pom.xml, e.g.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>31.0.1-jre</version>
        </dependency>
    </dependencies>
</dependencyManagement>

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 15, 2022

好的,我得测试一下,不过不一定能升,启动后也可能随时爆出找不到类找不到方法的问题

@cjdxhjj
Copy link
Author

cjdxhjj commented Jul 15, 2022

我有好几个应用,依赖复杂点的应用用不了2.0。用1.6没问题,不过不兼容jdk 17,没有add opens

@stale
Copy link

stale bot commented Aug 14, 2022

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 14, 2022
@stale
Copy link

stale bot commented Aug 31, 2022

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants