由于 JavaScript 验证,Eclipse 构建工作区在导入现有 Maven 项目后挂起

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22547639/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 21:35:54  来源:igfitidea点击:

Eclipse building workspace hangs after importing existing maven project because of JavaScript validation

javascripteclipsevalidationeclipse-kepler

提问by user3444334

When running Eclipse Kepler and importing an existing Maven project, Eclipse hangs during "Building Workspace (XX%)". Switching to the Progress tab reveals a "Validating nnn"; it looks like it's validating a directory containing JavaScript files.

运行 Eclipse Kepler 并导入现有 Maven 项目时,Eclipse 在“Building Workspace (XX%)”期间挂起。切换到“进度”选项卡会显示“正在验证 nnn”;看起来它正在验证包含 JavaScript 文件的目录。

回答by user3444334

  • Kill Eclipse process.

  • Go to project folder and edit .project file.

  • Remove the following lines (it will disable failing JavaScript validator):

    <buildCommand>
      <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
      <arguments>
      </arguments>
    </buildCommand>
    
  • Save file.

  • Re-open Eclipse.

  • 杀死 Eclipse 进程。

  • 转到项目文件夹并编辑 .project 文件。

  • 删除以下行(它将禁用失败的 JavaScript 验证器):

    <buildCommand>
      <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
      <arguments>
      </arguments>
    </buildCommand>
    
  • 保存存档。

  • 重新打开 Eclipse。

回答by Mahin

I faced the same problem when I tried to install Angular.js with bower in my project. I seems bower has lots of javascript files it downloaded automatically which caused my IDE to stuck in validation process for a long time. So, I solved this problem this way,

当我尝试在我的项目中使用 bower 安装 Angular.js 时,我遇到了同样的问题。我似乎 bower 有很多自动下载的 javascript 文件,这导致我的 IDE 长时间停留在验证过程中。所以,我是这样解决这个问题的,

  • I first installed tern.js 0.9.0.
  • Then I went to the project properties, selected tern script path included only the path I needed for validation, My project's javascript folder. I excluded other path like placeholders, Angular.js files, Jquery files.
  • I selected the Javascript from the properties again and did the same things in include path's source.
  • 我首先安装了 tern.js 0.9.0。
  • 然后我转到项目属性,选择的 tern 脚本路径只包括我验证所需的路径,我的项目的 javascript 文件夹。我排除了其他路径,如占位符、Angular.js 文件、Jquery 文件。
  • 我再次从属性中选择了 Javascript,并在包含路径的源代码中做了同样的事情。

My IDE currently working without freezing. I took help from there. TernI guess it can be helpful, where any IDE stuck due to lots of Javascript file.

我的 IDE 目前可以正常工作而不会冻结。我从那里得到了帮助。Tern我想这可能会有所帮助,因为有很多 Javascript 文件,任何 IDE 都卡住了。