Eclipse 中的指标插件问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13698192/
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
Metrics Plugin issue in Eclipse
提问by John
I have installed Metrics Plguin 1.3.8 in eclipse 3.7 indigo.After intalling and giving my system a restart I cant see any Metrics option in Project properties.
我已经在 eclipse 3.7 indigo 中安装了 Metrics Plguin 1.3.8。安装并重新启动系统后,我在项目属性中看不到任何 Metrics 选项。
Any one have any idea on this.
任何人对此都有任何想法。
回答by chan
I had the same problem with Eclipse Juno and metrics 1 (1.3.6) .
我在 Eclipse Juno 和 metrics 1 (1.3.6) 上遇到了同样的问题。
After a few Eclipse upgrade and theming, the metrics doesn't work anymore. It was just showing the calculation progression but it doesn't display the calculation results anymore.
在几次 Eclipse 升级和主题化之后,这些指标不再起作用。它只是显示计算进度,但不再显示计算结果。
After some net search, i found that http://metrics.sourceforge.net/evolve into http://metrics2.sourceforge.net/, so i make the change. But, the metrics 2 (1.3.8) shows the same problem.
经过一些网络搜索,我发现http://metrics.sourceforge.net/演变为http://metrics2.sourceforge.net/,所以我进行了更改。但是,指标 2 (1.3.8) 显示了相同的问题。
After a little search in my Eclipse workspace files, i found a directory named ".metadata". Then a sub directory named ".plugins". Then a sub directory named "net.sourceforge.metrics" with two files inside :
在我的 Eclipse 工作区文件中稍作搜索后,我找到了一个名为“.metadata”的目录。然后是一个名为“.plugins”的子目录。然后是一个名为“net.sourceforge.metrics”的子目录,里面有两个文件:
- metricsdb.db
- metricsdb.lg
- 指标数据库
- 指标数据库
So, after quitting Eclipse, i go to "MyJunoWorkspace/.metadata/.plugins/net.sourceforge.metrics/" directory, then i move the two files to another place, relaunch Eclipse, make a clean/full rebuild of my project from the package view. The metrics calculation results are now redisplayed. The dependency graph is also redisplayed.
因此,退出 Eclipse 后,我转到“MyJunoWorkspace/.metadata/.plugins/net.sourceforge.metrics/”目录,然后将这两个文件移动到另一个位置,重新启动 Eclipse,从包视图。现在重新显示指标计算结果。依赖关系图也会重新显示。
The first step of version switching (metrics 1 to 2), result from my tests, and couldn't be necessary in all cases. Try first to move the two files.
版本切换的第一步(指标 1 到 2)是我测试的结果,并非在所有情况下都是必需的。首先尝试移动这两个文件。
回答by Michael
When you right-click the project to open its properties, make sure you are in the Package Explorerview. It doesn't work if you are in Project Explorer.
当您右键单击该项目以打开其属性时,请确保您位于Package Explorer视图中。如果您在 Project Explorer 中,则它不起作用。
回答by msl
To show up the Metrics window:
要显示“指标”窗口:
1) Click on 'Window' in the top options bar.
1) 单击顶部选项栏中的“窗口”。
2) Select 'Show View' -> 'Other' -> 'Metrics' -> 'Metrics View'.
2) 选择“显示视图”->“其他”->“指标”->“指标视图”。
To Enable Project Metrics:
启用项目指标:
1) Right click on project.
1) 右键单击项目。
2) Select 'Properties'.
2) 选择“属性”。
3) Click on 'Metrics' label.
3) 单击“指标”标签。
4) Check the 'Enable Metrics'.
4) 勾选“启用指标”。
You should be in the Package Explorer view.
您应该在 Package Explorer 视图中。
回答by user2853437
I had a method declared twice in my unit test. This Error was hardly noticeable, since my Coverage was showing results.
我在单元测试中有一个方法声明了两次。这个错误几乎没有引起注意,因为我的 Coverage 显示了结果。
Anyway, the ERROR in my Code was the reason I didn't see any more updates from the Plugin.
无论如何,我的代码中的错误是我没有看到插件更新的原因。
回答by blessy kiran00
In my case, metrics was not enabled. so 1.) right click on the project in package explorer 2.) click on properties 3.) select metric 4.) enable the metrics 5.) click on apply and close
就我而言,指标未启用。所以 1.) 右键单击包资源管理器中的项目 2.) 单击属性 3.) 选择指标 4.) 启用指标 5.) 单击应用并关闭
thats it ..
就是这样 ..
回答by theCuriosityEnthusiast
Right click on the Java Project in your Project Explorer. Then go to "Configure > Convert to Plug-in Projects", then click Finish in the dialog box.
在您的项目资源管理器中右键单击 Java 项目。然后转到“配置 > 转换为插件项目”,然后在对话框中单击“完成”。
Now again right click on the Java Project in your Project Explorer. Now go to "Preferences", you'll find "Metrics" in the left-hand side panel. Click on it and select "Enable Metrics". Now the Metrics view will show the computed metrics.
现在再次右键单击您的项目资源管理器中的 Java 项目。现在转到“首选项”,您将在左侧面板中找到“指标”。单击它并选择“启用指标”。现在 Metrics 视图将显示计算出的指标。
I'm using Eclipse Juno and Metrics 1.3.8.
我正在使用 Eclipse Juno 和 Metrics 1.3.8。
回答by Martin Brassard
I know that I sounds like reviving the dead but I had a similar issue when upgrading from Indigo to Mars.
我知道我听起来像是复活了死者,但是从 Indigo 升级到 Mars 时我遇到了类似的问题。
The plugin installed properly and everything but I couldn't configure or use it. I looked at the web and couldn't find anything until I remember that the first step is ALWAYS looking at the log (.metadata/.log). And this is what appear:
插件安装正确,但我无法配置或使用它。我查看了网络并找不到任何东西,直到我记得第一步总是查看日志(.metadata/.log)。这是出现的内容:
!MESSAGE Plug-in at '.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/com.stateofflow.eclipse.metrics_3.14.1.201104282140' does not have an OSGi bundle manifest. To use a 2.0 style plug-in you must install the plug-in converter service. Go to Help > Install New Software and install 'Eclipse 2.0 Style Plugin Support' from 'The Eclipse Project Updates' software site.
!MESSAGE Plug-in at '.eclipse/org.eclipse.platform_3.7.0_155965261/plugins/com.stateofflow.eclipse.metrics_3.14.1.201104282140' 没有 OSGi 包清单。要使用 2.0 样式的插件,您必须安装插件转换器服务。转到“帮助”>“安装新软件”并从“Eclipse 项目更新”软件站点安装“Eclipse 2.0 样式插件支持”。
I the installed the Eclipse 2.0 Style Plugin Support and reinstalled metrics et voila! Everything back to normal.
我安装了 Eclipse 2.0 Style Plugin Support 并重新安装了指标等等!一切恢复正常。
Hope this helps as I ended here while troubleshooting.
希望这会有所帮助,因为我在故障排除时到此为止。