jdk自带工具jdeps,可分析class依赖关系(依赖的其它类和jar)。
团队,可以在此工具结果的基础上再详细分析对比出增量文件; 思路如下:
- jdeps分别分析出旧包和新包的文件依赖关系。并对比出新增的文件列表、删除的文件列表,分别加入到待更新的文件列表
- 分析出依赖关系没变化的文件列表,分别计算这些文件在旧包和新包的md5值。如果md5值不同,则表示文件有变化,也加入到待更新的文件列表
jdeps使用举例:(分析UserController.class)
# -cp指定classpath。多个classpath之间用“:”分割
# -f 过滤掉jdk文件
# -v 输出详细信息
jdeps -cp ".:../lib/*" -f java.* -v com/ruoyi/project/system/user/controller/UserController.class
输出结果:
com.ruoyi.project.system.user.controller.UserController -> cn.hutool.extra.spring.SpringUtil hutool-all-5.8.3.jarcom.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.constant.Constants .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.constant.Constants$Command .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.constant.Constants$ProvinceCode .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.constant.Constants$ProvinceCode$Telecom10010 .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.exception.BusinessException .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.utils.Encryption .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.utils.RSACoder .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.utils.StringUtils .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.utils.poi.ExcelUtil .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.common.utils.security.ShiroUtils .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.framework.aspectj.lang.annotation.Log .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.framework.web.controller.BaseController .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.framework.web.domain.AjaxResult .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.framework.web.domain.BaseEntity .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.framework.web.page.TableDataInfo .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.bizmanage.order.service.IUserPropertyService .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.dept.domain.Dept .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.dept.service.IDeptService .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.post.service.IPostService .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.role.domain.Role .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.role.service.IRoleService .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.user.domain.User .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.user.domain.vo.EditableAttribute .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.user.service.EditableAttributeListConfig .com.ruoyi.project.system.user.controller.UserController -> com.ruoyi.project.system.user.service.IUserService .com.ruoyi.project.system.user.controller.UserController -> org.apache.shiro.authz.annotation.RequiresPermissions shiro-core-1.12.0.jarcom.ruoyi.project.system.user.controller.UserController -> org.hibernate.validator.internal.constraintvalidators.bv.EmailValidator hibernate-validator-6.2.5.Final.jarcom.ruoyi.project.system.user.controller.UserController -> org.slf4j.Logger slf4j-api-1.7.36.jarcom.ruoyi.project.system.user.controller.UserController -> org.slf4j.LoggerFactory slf4j-api-1.7.36.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.beans.factory.annotation.Autowired spring-beans-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.beans.factory.annotation.Value spring-beans-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.stereotype.Controller spring-context-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.ui.ModelMap spring-context-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.util.CollectionUtils spring-core-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.bind.annotation.GetMapping spring-web-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.bind.annotation.PathVariable spring-web-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.bind.annotation.PostMapping spring-web-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.bind.annotation.RequestMapping spring-web-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.bind.annotation.ResponseBody spring-web-5.3.27.jarcom.ruoyi.project.system.user.controller.UserController -> org.springframework.web.multipart.MultipartFile spring-web-5.3.27.jar