Intellij IDEA 热部署的功能突然不好使了 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ithrows
V2EX    Java

Intellij IDEA 热部署的功能突然不好使了

  •  
  •   ithrows 2017-12-11 15:40:07 +08:00 8025 次点击
    这是一个创建于 2930 天前的主题,其中的信息可能已经有所发展或是发生改变。
    每次修改完静态资源得重新打包才能看到效果,之前不需要打包或者重新发布就能看到效果的。感觉是因为设置错了 IDEA 的部署方式导致的,有大神知道原因吗?
    20 条回复    2019-07-31 13:10:50 +08:00
    chenguoyu
        1
    chenguoyu  
       2017-12-11 15:50:13 +08:00
    update classes and resources
    ithrows
        2
    ithrows  
    OP
       2017-12-11 15:54:38 +08:00
    @chenguoyu 那两个选项已经这样设置了,还是不起作用
    nicevar
        3
    nicevar  
       2017-12-11 16:27:40 +08:00
    再次点击部署的时候没有弹出四个选项的对话框?
    yzq007
        4
    yzq007  
       2017-12-11 16:37:53 +08:00
    debug 栏 deployment 最下面那个选中没?
    ithrows
        5
    ithrows  
    OP
       2017-12-11 16:41:59 +08:00
    @nicevar 没有出现对话框
    ithrows
        6
    ithrows  
    OP
       2017-12-11 16:45:25 +08:00
    @yzq007 你是说哪个位置的 debug 栏呢? 之前使用时不需要 debug 启动也可以看到更新的内容的。
    yzq007
        7
    yzq007  
       2017-12-11 16:50:04 +08:00
    alt+5 的 deployment 这个要设置,还有服务器 edit configurations 也要设置
    letitbesqzr
        8
    letitbesqzr  
       2017-12-11 16:57:32 +08:00
    自带的热部署? ... 用 jrebel 试试呢
    palmers
        9
    palmers  
       2017-12-11 17:21:34 +08:00
    可以从以下方面粗略排除下
    1. 检查部署的是 xx:war 还是 xx:war exploded
    2. 项目是否分模块了, 被修改文件在依赖模块中
    3. 是否存在静态资源文件缓存
    ithrows
        10
    ithrows  
    OP
       2017-12-11 17:27:48 +08:00
    @yzq007 没找到 deployment 的设置
    ithrows
        11
    ithrows  
    OP
       2017-12-11 17:29:44 +08:00
    @letitbesqzr 是自带的热部署,之前用的好好的,不知道怎么搞得就不好使了。jrebel 也不管用。
    ithrows
        12
    ithrows  
    OP
       2017-12-11 17:32:11 +08:00
    @palmers 1.是 exploded 方式,2.没有分模块,3.没有缓存。推测原因是每次部署的是 war 包,修改的文件没有打进 war 就不起作用。但是又由于是 exploded 方式的,所以很费解。
    nicevar
        13
    nicevar  
       2017-12-11 18:14:16 +08:00
    检查一下运行配置里面的 Deployment,如果没问题项目是 maven 组织的话 mvn clean 看还是否出现
    chenguoyu
        14
    chenguoyu  
       2017-12-12 08:17:12 +08:00
    最后就是去输出文件夹里面看看,文件是否已经更新。
    ithrows
        15
    ithrows  
    OP
       2017-12-12 09:06:19 +08:00
    @chenguoyu 输出文件夹里面的文件没有更新,这是什么原因?
    chenguoyu
        16
    chenguoyu  
       2017-12-12 09:42:40 +08:00
    @ithrows 在设置服务器的页面中,下面有个 before launch,在部署前应该有 build,有没有不小心删掉了
    ithrows
        17
    ithrows  
    OP
       2017-12-12 09:45:58 +08:00
    @chenguoyu 有的,没被删掉
    chenguoyu
        18
    chenguoyu  
       2017-12-12 09:56:14 +08:00
    没碰到过这种情况,要不 file->invalidate caches/restart 试下吧
    YzSama
        19
    YzSama  
       2017-12-25 17:02:59 +08:00
    试试 ctrl+F9,使用 jrebel 可以实现热加载。多模块稍微有点复杂
    TimerKai
        20
    TimerKai  
       2019-07-31 13:10:50 +08:00
    遇到相同的情况,maven 项目,原因是页面被人在 pom.xml 里用 warSourceExcludes 标签排除了.......虽然是坟贴,但是我百度到这里了,希望给后来的遇到类似情况的人一些参考吧....吃我一记洛阳铲!(`·ω·)
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     861 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 30ms UTC 20:06 PVG 04:06 LAX 12:06 JFK 15:06
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86