为 Eclipse 安装检查样式插件时出错

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11865025/
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 18:46:58  来源:igfitidea点击:

Error while installing check style plugin for eclipse

eclipsecheckstylesevntu-checkstyle

提问by user1564922

I am getting the following error while installing the checkstyle plugin for my eclipuse via the update manager

通过更新管理器为我的 eclipuse 安装 checkstyle 插件时出现以下错误

Cannot complete the install because one or more required items could not be found. Software being installed: EclipseCS SevNTU plugin feature 1.5.0 (com.github.sevntu.checkstyle.checks.feature.feature.group 1.5.0) Missing requirement: Sevntu eclipse-cs Extension Plugin 1.5.0 (com.github.sevntu.checkstyle.checks 1.5.0) requires 'bundle net.sf.eclipsecs.core 0.0.0' but it could not be found Cannot satisfy dependency: From: EclipseCS SevNTU plugin feature 1.5.0 (com.github.sevntu.checkstyle.checks.feature.feature.group 1.5.0) To: com.github.sevntu.checkstyle.checks [1.5.0]

无法完成安装,因为找不到一个或多个必需的项目。正在安装的软件:EclipseCS SevNTU 插件功能 1.5.0 (com.github.sevntu.checkstyle.checks.feature.feature.group 1.5.0) 缺少要求:Sevntu eclipse-cs 扩展插件 1.5.0 (com.github.sevntu. checkstyle.checks 1.5.0) 需要 'bundle net.sf.eclipsecs.core 0.0.0' 但找不到它不能满足依赖:来自:EclipseCS SevNTU 插件功能 1.5.0 (com.github.sevntu.checkstyle.checks .feature.feature.group 1.5.0) 至:com.github.sevntu.checkstyle.checks [1.5.0]

I am using the below update site.

我正在使用以下更新站点。

http://eclipse-cs.sf.net/update/

http://eclipse-cs.sf.net/update/

I have googled a lot on this but could not find a appropriate solution. Please help. Thanks in advance

我在谷歌上搜索了很多,但找不到合适的解决方案。请帮忙。提前致谢

回答by Ashutosh Jindal

When you attempt to install is Contact all update sites during install to find required softwarechecked ? If not, it should be :

当您尝试安装时被Contact all update sites during install to find required software选中?如果没有,它应该是:

enter image description here

在此处输入图片说明

Expected Result

预期结果

When using the update site in OP's post, following is the expected result : enter image description here

在 OP 的帖子中使用更新站点时,预期结果如下: 在此处输入图片说明

Offline Installation

离线安装

From thispage :

这个页面:

Alternatively the Checkstyle Eclipse Plug-in can be downloaded from the Eclipse Checkstyle Plug-in's SourceForge download site. The download consists of a archived update site (file name net.sf.eclipsecs-x.x.x.buildstamp-updatesite.zip), containing all mandatory and optional parts of the plugin.

The plugin can be installed from the archived update site in the following ways:

1. Via Eclipse's P2 Installation Manager similar as described above, pointing to the archive file instead
2. Extracted into Eclipse's dropins folder. 

或者,可以从 Eclipse Checkstyle 插件的 SourceForge 下载站点下载 Checkstyle Eclipse 插件。下载包含一个存档的更新站点(文件名 net.sf.eclipsecs-xxxbuildstamp-updatesite.zip),其中包含插件的所有必需和可选部分。

可以通过以下方式从存档的更新站点安装插件:

1. Via Eclipse's P2 Installation Manager similar as described above, pointing to the archive file instead
2. Extracted into Eclipse's dropins folder. 

So, the steps are as follows :

因此,步骤如下:

  1. Download the file referred above from here

  2. Add the downloaded file as an 'Archived Download site' like so :

  1. 这里下载上面提到的文件

  2. 将下载的文件添加为“存档下载站点”,如下所示:

enter image description here

在此处输入图片说明

  1. After that you should get the following :
  1. 之后你应该得到以下信息:

enter image description here

在此处输入图片说明

回答by shashi009

I think Ashutosh' answer should have worked, alternatively another option is to download the zip archive from http://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/5.5.0/and extract it to eclipse plugins folder.

我认为 Ashutosh 的回答应该有效,或者另一种选择是从http://sourceforge.net/projects/eclipse-cs/files/Eclipse%20Checkstyle%20Plug-in/5.5.0/下载 zip 存档 并将其解压缩eclipse插件文件夹。

回答by ROMANIA_engineer

Eclipse Mars (4.5.1)

日食火星 (4.5.1)

Installation

安装

You can install Checkstyle plugin from the Marketplace.

您可以从Marketplace安装 Checkstyle 插件。

  1. Help > Eclipse Martketplace...

    Eclipse Marketplace

  2. Type "checkstyle plug-in"and hit Enter.

    You can also type only checkstyleand then select the plugin from the list.

    Click on Install.

    install

  1. 帮助 > Eclipse 市场...

    日食市场

  2. 键入"checkstyle plug-in"并点击Enter

    您也可以只输入checkstyle然后从列表中选择插件。

    单击安装

    安装

Usage

用法

  1. Window > Show View > Other...

    Show view

  2. Type checkstyle> select the views (Ctrl+ click) > OK

    checkstyle views

  3. Right click on your project > Checkstyle > Check Code with Checkstyle

    check code

    The output will be shown in the checkstyle views (2 tabs).

    If you listed all the violations for a type (using the arrow / right click / double click), you can go back using the "Go back to the master view" arrow:

    go back arrow

  1. 窗口 > 显示视图 > 其他...

    Show view

  2. 类型checkstyle> 选择视图(Ctrl+ 单击)> OK

    checkstyle views

  3. 右键单击您的项目 > Checkstyle > 使用 Checkstyle 检查代码

    check code

    输出将显示在 checkstyle 视图(2 个选项卡)中。

    如果您列出了某个类型的所有违规(使用箭头/右键单击/双击),您可以使用“返回主视图”箭头返回:

    go back arrow

回答by Meng Lu

I think the caveat here is the plugin's homepage http://eclipse-cs.sourceforge.net/gives http://sevntu-checkstyle.github.com/sevntu.checkstyle/update-site/as the installation URL, but it does not work (Yes?). However on http://eclipse-cs.sourceforge.net/downloads.htmla different installation URL http://eclipse-cs.sf.net/update/is given, which turns out to work correctly.

我认为这里的警告是插件的主页http://eclipse-cs.sourceforge.net/提供http://sevntu-checkstyle.github.com/sevntu.checkstyle/update-site/作为安装 URL,但它确实不工作(是吗?)。但是在http://eclipse-cs.sourceforge.net/downloads.html 上给出了不同的安装 URL http://eclipse-cs.sf.net/update/,结果证明它可以正常工作。