[英]Add library to Vaadin Web App project in Netbeans
I recently used the Library Manager in Netbeans (8.2, on Windows 10) to add a library, as show below: 我最近在Netbeans(在Windows 10上为8.2)中使用了图书馆管理器来添加一个图书馆,如下所示:
However, in most guides I find online, in order to actually add the library to the project, I should do the following: 但是,在我在线上找到的大多数指南中,为了将库实际添加到项目中,我应该执行以下操作:
Right click the project -> Select the Libraries tab -> .... further steps .... However, I haven't even been able to make it past the second step: the Libraries tab simply does not exist on my project properties, as seen below: Is this because the structure for a Vaadin web app project is so different from other Netbeans projects? 右键单击项目->选择“库”选项卡-> ....进一步的步骤....但是,我什至无法通过第二步:“库”选项卡在我的项目属性中根本不存在,如下所示:这是因为Vaadin Web应用程序项目的结构与其他Netbeans项目有很大不同吗? Any advice would be appreciated
任何意见,将不胜感激
Don't. 别。
Do not configure libraries manually for your Vaadin project. 不要为您的Vaadin项目手动配置库。
Instead, create a new Vaadin project using the template of a Maven archetype provided by the Vaadin Ltd company. 而是使用Vaadin Ltd公司提供的Maven 原型模板创建一个新的Vaadin项目。 Locate and edit the new project's
POM.xml
file to list the libraries you need Maven to automatically download and install. 找到并编辑新项目的
POM.xml
文件,以列出您需要Maven自动下载和安装的库。
For Vaadin Framework (Vaadin 8), see: 有关Vaadin框架(Vaadin 8),请参阅:
Usually Vaadin projects are configured using the Apache Maven tool. 通常,Vaadin项目是使用Apache Maven工具配置的。
Maven is quite popular across all kinds of Java projects. Maven在各种Java项目中都非常流行。 All three major IDEs (NetBeans, IntelliJ, Eclipse) support Maven-driven projects as an alternative to their own particular project definition system.
所有三个主要的IDE(NetBeans,IntelliJ,Eclipse)都支持Maven驱动的项目,以替代其自己的特定项目定义系统。
Maven has two purposes: Maven有两个目的:
You specify both the project-build configuration and your list of desired libraries (“dependencies”) in one or more POM.xml
files. 您可以在一个或多个
POM.xml
文件中同时指定项目构建配置和所需库(“依赖关系”)列表。
Using Maven eliminates the need to place libraries manually as you are attempting to do. 使用Maven无需在尝试进行操作时手动放置库。 No need to touch the NetBeans Library Manager .
无需触摸NetBeans 库管理器 。 Indeed, I believe manually configuring libraries will conflict with Maven, with troubled results.
确实,我相信手动配置库将与Maven冲突,从而产生麻烦的结果。
Using Maven is annoying at first, having to learn the lingo and the concepts. 刚开始使用Maven很烦,必须学习术语和概念。 But once you are orientated, Maven does save you time and trouble, and makes your developer life easier.
但是一旦您适应了Maven,Maven确实可以节省您的时间和麻烦,并使您的开发人员生活更轻松。 One big benefit: Maven makes switching between the 3 main IDEs much easier since you don't have to learn about each one's own idiosyncratic project-build-system.
一个很大的好处:Maven使得在3个主要IDE之间的切换变得更加容易,因为您不必了解每个人自己的特有项目构建系统。
I recommend you take a few hours to learn the basics. 我建议您花一些时间来学习基础知识。 You'll find many introductions and tutorials on Maven.
您会在Maven上找到许多介绍和教程。
The Vaadin Ltd company provides a few good Maven archetypes for a new Vaadin project. Vaadin Ltd公司为新的Vaadin项目提供了一些很好的Maven原型 。
vaadin-archetype-application
vaadin-archetype-application-multimodule
By the way, Vaadin development in previous years virtually required the use of a Vaadin-savvy plugin that you would have to install into your IDE. 顺便说一句,前几年Vaadin的开发实际上需要使用精通Vaadin的插件,您必须将其安装到IDE中。 Such a plug-in is no longer needed, now supplanted by Maven.
不再需要这种插件,现在已被Maven取代。 You can ignore old outmoded guides to Vaadin that talk about an IDE plug-in for Vaadin.
您可以忽略有关Vaadin的过时过时的指南,这些指南谈论了Vaadin的IDE插件。
Note: This entire Answer applies to Vaadin 8 ( Vaadin Framework ) specifically, and probably Vaadin 7 (as I recall). 注意:整个答案特别适用于Vaadin 8( Vaadin Framework ),也可能适用于Vaadin 7(我记得)。 Vaadin 10 ( Vaadin Flow ) is a new ballgame, and I am not yet familiar with the situation there.
Vaadin 10( Vaadin Flow )是一个新的球类游戏,我对那里的情况还不熟悉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.