简体   繁体   中英

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). At deployment time, the netbeans build system packages all these libraries in a {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. 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. 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. 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)

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

It will add the jar in your local repository and then you can add the dependency in your pom. You can refer to this link too -: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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