grunt插件刷新Eclipse Java项目

 sumoly_ 发布于 2023-01-20 14:41

背景:

我有一个使用lesscss的Java项目。我使用gruntgrunt-contrib-watchgrunt-contrib-less to compile my.LESS files to.css`。

一切都很好。

问题是要使eclipse Tomcat服务器开始提供更新的.css文件,我需要刷新eclipse中的项目。

我在徘徊,是否有一种方法可以使日蚀watch在咕unt声中作为周期的一部分进行刷新?或者实际上,是否有办法使用grunt刷新当前打开的eclipse项目(鉴于我知道它的路径,如果有帮助的话)。

将其连接到手表周期并不难,并且可以通过更改以下项来完成Gruntfile.js

    watch: {
        styles: {
            // Which files to watch (all .less files recursively in the less directory)
            files: ['../WebContent/less/**/*.less'],
            tasks: ['less'],
            options: {
              nospawn: true
            }
        },

至:

    watch: {
        styles: {
            // Which files to watch (all .less files recursively in the less directory)
            files: ['../WebContent/less/**/*.less'],
            tasks: ['less','updateEclipseTask'],
            options: {
              nospawn: true
            }
        },

Aule.. 5

尝试启用Preferences > General > Workspace > Refresh using native hooks or polling。根据您所使用的操作系统,它会或多或少地刷新。这不是您想要的,但可以解决问题。

我还没有尝试过但看起来可以使用的另一种选择是,如果创建新的“程序”配置,则使用eclipse-remote-control触发您在Eclipse(Run > External Tools > External Tools Configurations...)中设置的外部命令在那里,您可以在“刷新”选项卡中将Eclipse设置为在执行该外部工具配置时刷新工作空间。

要从grunt 运行eclipse-remote-control,可以使用grunt-shell

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有