简体   繁体   English

将Maven或其他第三方库添加到现有的JavaFX netbeans项目

[英]Adding maven or other third party libraries to existing JavaFX netbeans project

I created a project using Netbeans 8.1's JavaFX application wizard, however in order to the final project to compile, I manually have to add third party library dependencies (downloading the source code, documentation and class jars and adding these to named libraries). 我使用Netbeans 8.1的JavaFX应用程序向导创建了一个项目,但是为了编译最终项目,我必须手动添加第三方库依赖项(下载源代码,文档和类jar并将其添加到命名库中)。 At deployment time, the netbeans build system packages all these libraries in a {projectName}/dist/lib/*.jar . 在部署时,netbeans构建系统将所有这些库打包在{projectName}/dist/lib/*.jar

Maintaining this set of 3rd party libraries has become very time consuming especially when I bring develop on another PC in another location. 维护这套第三方库变得非常耗时,尤其是当我在另一位置的另一台PC上进行开发时。 As I understand it, the way to resolve this is through a Maven dependency pom.xml with individual libraries and their version called out and pointing to an online maven repository to automatically download the jars, unfortunately I have no idea how to add this to an EXISTING Netbeans project. 据我了解,解决此问题的方法是通过Maven依赖pom.xml并调用各个库及其版本,并指向一个在线Maven存储库以自动下载jar,不幸的是,我不知道如何将其添加到现有的Netbeans项目。 Does anyone have any pointers on how I can either use maven or some other way of automatically adding 3rd party library support to my project. 是否有人对我如何使用maven或以其他方式自动向项目添加第三方库支持提供任何指示。 I have a list of about a dozen or so third party library dependencies (all of which can be downloaded from Maven - I did already download these and manually package each one) 我列出了大约12个左右的第三方库依赖项(都可以从Maven下载-我确实已经下载了这些库并手动打包了每个库)

For installing third party jars into your repository, you can use this command -: mvn install:install-file -Dfile=path-to-file -DgroupId= -DartifactId=artifact-id -Dversion=version -Dpackaging=packaging 要将第三方jar安装到存储库中,可以使用以下命令-:mvn install:install-file -Dfile =文件路径-DgroupId = -DartifactId = artifact-id -Dversion = version -Dpackaging = packaging

It will add the jar in your local repository and then you can add the dependency in your pom. 它将把jar添加到本地存储库中,然后可以在pom中添加依赖项。 You can refer to this link too -: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html 您也可以参考此链接-: https : //maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

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

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