ithrows
V2EX  ›  Java

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

  •  
  •   ithrows · Dec 11, 2017 · 8330 views
    This topic created in 3122 days ago, the information mentioned may be changed or developed.
    每次修改完静态资源得重新打包才能看到效果,之前不需要打包或者重新发布就能看到效果的。感觉是因为设置错了 IDEA 的部署方式导致的,有大神知道原因吗?
    20 replies    2019-07-31 13:10:50 +08:00
    chenguoyu
        1
    chenguoyu  
       Dec 11, 2017
    update classes and resources
    ithrows
        2
    ithrows  
    OP
       Dec 11, 2017
    @chenguoyu 那两个选项已经这样设置了,还是不起作用
    nicevar
        3
    nicevar  
       Dec 11, 2017
    再次点击部署的时候没有弹出四个选项的对话框?
    yzq007
        4
    yzq007  
       Dec 11, 2017
    debug 栏 deployment 最下面那个选中没?
    ithrows
        5
    ithrows  
    OP
       Dec 11, 2017
    @nicevar 没有出现对话框
    ithrows
        6
    ithrows  
    OP
       Dec 11, 2017
    @yzq007 你是说哪个位置的 debug 栏呢? 之前使用时不需要 debug 启动也可以看到更新的内容的。
    yzq007
        7
    yzq007  
       Dec 11, 2017
    alt+5 的 deployment 这个要设置,还有服务器 edit configurations 也要设置
    letitbesqzr
        8
    letitbesqzr  
       Dec 11, 2017
    自带的热部署? ... 用 jrebel 试试呢
    palmers
        9
    palmers  
       Dec 11, 2017
    可以从以下方面粗略排除下
    1. 检查部署的是 xx:war 还是 xx:war exploded
    2. 项目是否分模块了, 被修改文件在依赖模块中
    3. 是否存在静态资源文件缓存
    ithrows
        10
    ithrows  
    OP
       Dec 11, 2017
    @yzq007 没找到 deployment 的设置
    ithrows
        11
    ithrows  
    OP
       Dec 11, 2017
    @letitbesqzr 是自带的热部署,之前用的好好的,不知道怎么搞得就不好使了。jrebel 也不管用。
    ithrows
        12
    ithrows  
    OP
       Dec 11, 2017
    @palmers 1.是 exploded 方式,2.没有分模块,3.没有缓存。推测原因是每次部署的是 war 包,修改的文件没有打进 war 就不起作用。但是又由于是 exploded 方式的,所以很费解。
    nicevar
        13
    nicevar  
       Dec 11, 2017
    检查一下运行配置里面的 Deployment,如果没问题项目是 maven 组织的话 mvn clean 看还是否出现
    chenguoyu
        14
    chenguoyu  
       Dec 12, 2017
    最后就是去输出文件夹里面看看,文件是否已经更新。
    ithrows
        15
    ithrows  
    OP
       Dec 12, 2017
    @chenguoyu 输出文件夹里面的文件没有更新,这是什么原因?
    chenguoyu
        16
    chenguoyu  
       Dec 12, 2017
    @ithrows 在设置服务器的页面中,下面有个 before launch,在部署前应该有 build,有没有不小心删掉了
    ithrows
        17
    ithrows  
    OP
       Dec 12, 2017
    @chenguoyu 有的,没被删掉
    chenguoyu
        18
    chenguoyu  
       Dec 12, 2017
    没碰到过这种情况,要不 file->invalidate caches/restart 试下吧
    YzSama
        19
    YzSama  
       Dec 25, 2017
    试试 ctrl+F9,使用 jrebel 可以实现热加载。多模块稍微有点复杂
    TimerKai
        20
    TimerKai  
       Jul 31, 2019
    遇到相同的情况,maven 项目,原因是页面被人在 pom.xml 里用 warSourceExcludes 标签排除了.......虽然是坟贴,但是我百度到这里了,希望给后来的遇到类似情况的人一些参考吧....吃我一记洛阳铲!(`・ω・´)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   921 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    ♥ Do have faith in what you're doing.