有谁知道如何解决此错误,以将Findbugs安装到Netbeans 8.2中? [英] Does anyone know how to fix this error to install Findbugs into Netbeans 8.2?

查看:160
本文介绍了有谁知道如何解决此错误,以将Findbugs安装到Netbeans 8.2中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Findbugs安装到Netbeans 8.2中时出现以下错误:

 存储时存在一些问题建立连接…原因:无法解析对m2:/org:ow2:asm:asm-debug-all:5.0.2:jar的外部引用" 

我曾尝试卸载NetBeans 8.2并删除与安装相关的所有内容,以得到在那里没有成功的全新安装,并且我尝试了最新版本的NetBeans 11.3,但我发现该版本没有Findbugs可用.我需要一个学校项目的插件,那里也没有人可以帮助我解决这个问题.任何帮助将不胜感激.

我正在使用Windows 10 PC.

谢谢.

解决方案

错误原因

发生错误是因为下载插件时,NetBeans也会尝试下载其他依赖项.从中下载jar的链接写在 nbm 包中.

例如,依赖项之一是 asm-debug-all-5.0.2.jar ,链接是:

  http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2.jar. 

不再可以使用 HTTP 链接访问maven存储库.您可以在

  1. 单击检查后,报告将准备就绪.它在NetBeans 11.3和8.2上均可使用.确保您将

    I am getting below error while installing Findbugs into Netbeans 8.2:

    "There were some problems while storing Establishing a connection …
    Cause: Cannot resolve external reference to m2:/org:ow2:asm:asm-debug-all:5.0.2:jar"
    

    I have tried uninstalling NetBeans 8.2 and removing anything associated with the installation to get a fresh install with no success there, and I have tried the latest version of NetBeans 11.3 which I found does not have Findbugs available. I need the plugin for a school project and no one there has been able to help me with this issue either. Any help would be greatly appreciated.

    I am using a Windows 10 PC.

    Thank you.

    解决方案

    The reason of the error

    The error happens because when you download the plugin, NetBeans also tries to download additional dependencies. The links where to download the jars from are written inside the nbm package.

    For example, one of the dependencies is asm-debug-all-5.0.2.jar, and the link is:

    http://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.2/asm-debug-all-5.0.2.jar. 
    

    The maven repository is no longer accessible using the HTTP link. You can read more about it here. So basically, you could not install the plugin because the plugin is outdated and contains invalid links for downloading dependencies from maven repo.

    Before solving the issue, consider using SpotBug instead because the FindBug is outdated and is no longer actively maintained, for more information, please, see here in another answer. Also, keep in mind that it works only with JDK8.

    How to solve it?

    To solve the issue, you need to fiddle around a bit with plugins.

    1. You need two plugins FindBug Libs (org-netbeans-libs-findbugs.nbm) and FindBug Integration (org-netbeans-modules-findbugs.nbm). Download them using thees links:

    https://updates.netbeans.org/netbeans/updates/8.2/uc/final/certified/82/extra/org-netbeans-modules-findbugs.nbm

    https://updates.netbeans.org/netbeans/updates/8.2/uc/final/certified/82/extra/org-netbeans-libs-findbugs.nbm

    1. Unzip org-netbeans-libs-findbugs.nbm manually as if it is a simple zip file.
    2. Edit the files in org-netbeans-libs-findbugs\netbeans\modules\ext extracted folder. In every file, you need to change the link from http to https.
    3. Edit manifest file org-netbeans-libs-findbugs\META-INF\MANIFEST.MF. You need to remove all lines that contain CRS checksum. After editing it should contains only these lines:

      Manifest-Version: 1.0 Ant-Version: Apache Ant 1.9.2 Created-By: 1.8.0_45-b14 (Oracle Corporation)

    4. Remover other two files in org-netbeans-libs-findbugs\META-INF (ORACLE_C.RSA and ORACLE_C.SF).

    5. Zip it again.

    After that, the file is ready for manually installing into Net Beans. Alternatively, you can download the file from here. I have already modified the plugin using the steps.

    How to install and use it?

    1. Got to Windows -> Plugins -> Downloaded -> Add Plugins
    2. Manually add the modified org-netbeans-libs-findbugs.nbm file and click install.
    3. Then add org-netbeans-modules-findbugs.nbm and click install.
    4. When installing, it shows that it downloads the plugin, but actually, it downloads only dependencies. It can take some time.
    5. After that, select your project in the project tree, make sure it was compiled before. Got to Source -> Inspect, choose FindBus in the Configuration.

    1. After you click to inspect your report will be ready. It works both on NetBeans 11.3 and 8.2. Make sure you are using JDK8 with NetBeans. I'm not sure it will work with the newest versions of JDK.

    Here is an example with running it on 11.3 using JDK8 on some NetBeans module:

    这篇关于有谁知道如何解决此错误,以将Findbugs安装到Netbeans 8.2中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆