NutzCN Logo
问答 Scans.java如何控制排除指定jar文件的资源文件加载?
发布于 2602天前 作者 wx_e4jchvgorn3d3900gcus 1937 次浏览 复制 上一个帖子 下一个帖子
标签:

11:58:19.959 INFO (Scans.java:266) scan - same resource path core/security/pojo/Role.class will be override by core/security/pojo/Role.class
11:58:19.960 INFO (Scans.java:266) scan - same resource path core/security/pojo/UserRole.class will be override by core/security/pojo/UserRole.class
11:58:19.961 INFO (Scans.java:266) scan - same resource path core/security/pojo/UserPermission.class will be override by core/security/pojo/UserPermission.class
11:58:19.962 INFO (Scans.java:266) scan - same resource path core/security/pojo/Permission.class will be override by core/security/pojo/Permission.class
11:58:19.966 INFO (Scans.java:266) scan - same resource path core/security/bean/PersonPerm.class will be override by core/security/bean/PersonPerm.class
11:58:19.974 INFO (Scans.java:266) scan - same resource path core/security/enums/PermissionEnum.class will be override by core/security/enums/PermissionEnum.class
11:58:19.974 INFO (Scans.java:266) scan - same resource path core/security/enums/ResourceType.class will be override by core/security/enums/ResourceType.class
11:58:20.395 INFO (Scans.java:266) scan - same resource path common/quartz/TimedMsgJob.class will be override by common/quartz/TimedMsgJob.class
11:58:20.412 DEBUG (Scans.java:274) scan - Found 880 resource by src( com/******/ ) , regex( ^.+[.]class$ )

12 回复

为啥会重复呢? nutz换新版吧

因为是多个子项目。其中子项目A依赖子项目B ,但是子项目B的资源文件覆盖了子项目A的资源文件。NUTZ版本是“1.r.60”

只是想去掉日志?? 改一下log4j配置就好了吧

不是想改日志,是想改加载过程。能否只优先加载项目A中的资源文件,而不是使用项目B的资源文件。

资源文件覆盖如下:
11:58:18.179 INFO (Scans.java:266) scan - same resource path [jpush.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/jpush.properties) will be override by jpush.properties
11:58:18.179 INFO (Scans.java:266) scan - same resource path [cron.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/cron.properties) will be override by cron.properties
11:58:18.179 INFO (Scans.java:266) scan - same resource path [rabbitmq.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/rabbitmq.properties) will be override by rabbitmq.properties
11:58:18.181 INFO (Scans.java:266) scan - same resource path [db.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/db.properties) will be override by db.properties
11:58:18.181 INFO (Scans.java:266) scan - same resource path jpush.properties will be override by jpush.properties
11:58:18.181 INFO (Scans.java:266) scan - same resource path cron.properties will be override by cron.properties
11:58:18.181 INFO (Scans.java:266) scan - same resource path [tencentIm.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/tencentIm.properties) will be override by tencentIm.properties
11:58:18.182 INFO (Scans.java:266) scan - same resource path [redis.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/redis.properties) will be override by redis.properties
11:58:18.182 INFO (Scans.java:266) scan - same resource path rabbitmq.properties will be override by rabbitmq.properties
11:58:18.183 INFO (Scans.java:266) scan - same resource path [mail.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/mail.properties) will be override by mail.properties
11:58:18.184 INFO (Scans.java:266) scan - same resource path [server.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/server.properties) will be override by server.properties
11:58:18.186 INFO (Scans.java:266) scan - same resource path [weixin.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/weixin.properties) will be override by weixin.properties
11:58:18.188 INFO (Scans.java:266) scan - same resource path [wxlogin.properties](custom/ /home/clark/workgroup/Git_workspace/backend/classes/artifacts/******-admin/exploded/******-admin-1.0.war/WEB-INF/classes/custom/wxlogin.properties) will be override by wxlogin.properties
11:58:18.191 INFO (Scans.java:266) scan - same resource path db.properties will be override by db.properties
11:58:18.191 DEBUG (Scans.java:274) scan - Found 24 resource by src( custom/ ) , regex( ^.+[.]properties$ )

调整一下build path顺序试试?

不知道怎么调整 build path.

我使用的是gradle来处理子项目依赖的。项目 A 依赖于 项目B 。在项目A发布到tomcat中启动时,项目B已经被打到JAR文件,放在于A项目的lib目录了。

换成1.r.62的话, 文件夹比jar优先

问题解决了。@wendal nutz 1.6.2太棒了!!!

刚去看了nutz的版本发行注释。原来1.6.1就解决了这个问题。而且速度确实变快了,启动嗖嗖的!!!

添加回复
请先登陆
回到顶部