gpt4 book ai didi

eclipse - grunt插件刷新eclipse java项目

转载 作者:行者123 更新时间:2023-12-05 00:26:30 25 4
gpt4 key购买 nike

背景:

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

这一切都很好。

问题是让eclipse tomcat服务器开始服务更新的.css我需要在 Eclipse 中刷新项目的文件。

我在徘徊是否有办法强制 eclipse 作为 watch 的一部分刷新循环咕噜?
或者实际上,有没有办法使当前打开的 eclipse 项目(假设我知道它的路径是否有帮助)使用 grunt 刷新。

将它连接到 watch 周期并不难,可能可以通过更改我的 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
}
},

最佳答案

尝试启用 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 .

关于eclipse - grunt插件刷新eclipse java项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22129029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com