简体   繁体   English

如何添加restfb。 jar to maven project on Apache NetBeans IDE 11.1? 项目中没有库类别 - >属性

[英]how to add restfb. jar to maven project on Apache NetBeans IDE 11.1? No libraries category in Project - >properties

I have a project in which i use Apache Netbeans IDE 11.1 and I want to use Facebook API by adding "restFB.jar" to my project I have a project in which i use Apache Netbeans IDE 11.1 and I want to use Facebook API by adding "restFB.jar" to my project

in previous versions of NetBeans, there was "Libraries" category in Project->Properties在以前版本的 NetBeans 中,项目->属性中有“库”类别

but now in Apache Netbeans IDE 11.1 I can't find the "Libraries" Category.但现在在 Apache Netbeans IDE 11.1 我找不到“库”类别。

How can I Add "restFB.jar" to my project in Apache Netbeans IDE 11.1如何在 Apache Netbeans IDE 11.1 中将“restFB.jar”添加到我的项目中

Below is what I am trying to do.以下是我正在尝试做的事情。 图 1 图 2 Thanx in advance提前感谢

The absence of the Category named Libraries for your project is nothing to do with NetBeans 11.1.您的项目缺少名为类别与 NetBeans 11.1 无关。 Maven projects in any version of NetBeans will not have a Category named Libraries because it is not needed. NetBeans 的任何版本中的 Maven 项目将没有名为类别,因为它不是必需的。 Instead, your application's dependencies are specified within pom.xml .相反,您的应用程序的依赖项在pom.xml中指定。

You can easily verify this by using the NetBeans project wizard:您可以使用 NetBeans 项目向导轻松验证这一点:

  • Create a Maven based application ( File > New Project... > Java with Maven > Java Application ). Create a Maven based application ( File > New Project... > Java with Maven > Java Application ).
  • Create an Ant based application ( File > New Project... > Java with Ant > Java Application ).创建一个基于 Ant 的应用程序(文件 > 新项目... > Java 和 Ant > ZD52387880E371EA228317A7 应用程序
  • The Ant application will have a Category named Libraries , and the Maven project will not. Ant 应用程序将有一个名为Libraries类别,而 Maven 项目将没有。

So to include restFB.jar in your Maven project:因此,要在 Maven 项目中包含restFB.jar

  • Go to https://mvnrepository.com and search for " restfb ". Go 到https://mvnrepository.com并搜索“ restfb ”。
  • A list of the possible choices will be shown.将显示可能选择的列表。 You want the topmost one named RestFB , so click that.您想要最上面的一个名为RestFB ,所以单击它。
  • On the RestFB page the topmost entry is the one you are looking for ( 3.0.0-rc.1 ), so click that link.RestFB页面上,最上面的条目是您要查找的条目 ( 3.0.0-rc.1 ),因此请单击该链接。
  • The <dependency> entry you need to add to pom.xml will be displayed on the Maven tab.您需要添加到pom.xml<dependency>条目将显示在Maven选项卡上。
  • Click that entry to copy it to the clipboard, then add it to the pom.xml for your project and rebuild.单击该条目将其复制到剪贴板,然后将其添加到项目的pom.xml并重新构建。

This is the Maven web page you need to copy the <dependency> entry:这是您需要复制<dependency>条目的 Maven web 页面

MavenRestFb

There are several sample RestFB examples on GitHub which may be helpful. GitHub 上有几个示例 RestFB 示例可能会有所帮助。 If you get stuck on your own project, try building and running those to help understand and isolate any other issues with your project.如果您卡在自己的项目上,请尝试构建和运行这些项目,以帮助理解和隔离项目中的任何其他问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM