Caused by: java.lang.ClassNotFoundException: javax.inject.Inject
Caused by: java.lang.ClassNotFoundException: javax.inject.Inject
一、问题描述
在项目编译时,找不到inject类
![Screen Shot 2022-08-31 at 00.05.08](https://img2022.cnblogs.com/blog/1994693/202208/1994693-20220831000802121-870464741.png)
二、分析问题
通过分析栈信息,发现querydsl包在读取Inject类是失败
![Screen Shot 2022-08-31 at 00.05.08](https://img2022.cnblogs.com/blog/1994693/202208/1994693-20220831000812120-1177538599.png)
通过分析maven包依赖, 发现对应的javax.inject包为runtime运行时加载
![Screen Shot 2022-08-31 at 00.05.08](https://img2022.cnblogs.com/blog/1994693/202208/1994693-20220831000823830-295797493.png)
三、解决方法
将配置了runtime的包排除
![Screen Shot 2022-08-31 at 00.05.08](https://img2022.cnblogs.com/blog/1994693/202208/1994693-20220831001843844-254582493.png)
![Screen Shot 2022-08-31 at 00.05.08](https://img2022.cnblogs.com/blog/1994693/202208/1994693-20220831001919163-1205512147.png)