登录 用户中心() [退出] 后台管理 注册
   
您的位置: 首页 >> SoftHub关联区 >> 主题: netbeans 14 Gradle 项目添加依赖 jar     [回主站]     [分站链接]
netbeans 14 Gradle 项目添加依赖 jar
clq
浏览(454) - 2022-07-26 16:05:11 发表 编辑

关键字:

[2022-07-26 16:06:48 最后更新]
netbeans 14 Gradle 项目添加依赖 jar

不知为何国内网站说的

runtime fileTree(dir: 'libs', include: '*.jar')

这样的全部不行。(版本太低?)

最后还是用 bing 国际版本搜索 “netbeans Gradle jar”找到了这篇老外的

https://mindfusion.eu/blog/3-ways-to-add-a-local-jplanner-jar-to-your-project-in-apache-netbeans/

即应该是
dependencies {

.....................................

implementation files('libs/JPlanner.jar')

}

不过不能用 *.jar

另外之所以用 Gradle 类型是项目实在是因为 nb14 默认的 Maven 类型项目会在新建时下载一个 1G 多的 index 文件 ... 这个文件在国内网下了一天,而且我硬盘不足了...

而 Gradle 大概是因为 android studio 也在用的原因吧,现在国内速度极快 ... 当然早几年它也是相当慢的...




clq  2022-07-26 16:06:48 发表 编辑


https://mindfusion.eu/blog/3-ways-to-add-a-local-jplanner-jar-to-your-project-in-apache-netbeans/
--------------------------------------------------------

3 Ways to Add a Local JPlanner.jar to Your Project in Apache NetBeans
Posted on January 16, 2022 by Diana

In this blog post we will look at 3 different ways to add the JPlanner.jar library to your project in the NetBeans IDE. The projects are:

Java Application with Maven
Java Application wtih Gradle
Java Appliation with Ant

We assume you have downloaded the JPlanner.jar either with the trial version of Scheduling for Java Swing or with one of the samples.

I. Java Application with Maven

Right click on the “Dependencies” node in your project tree and choose “Add Dependency”:

[Add Dependency in a Maven Project]

In the dialog that appears you can type the data for the JPlanner.jar. You can check the online documentation for the current version.

[Describe the Java Scheduler Data]

You can edit directly the pom.xml file of the project. Make sure you declare the JPlanner dependency inside the dependencies XML element:



eu.mindfusion
scheduling
2.1.3



The pom.xml file is in the “Project Files” folder of your project:

[The pom.xml file in your project]

Now you should see the JPlanner.jar under the Dependencies tree node. Now you should load it from your local jar file. Right-click on the dependency and choose ” The last step you should make to load the JPlanner file now is right-click on the dependency and choose “Manually install artifact”:

[Manual install the Java Scheduler artifact from the local JPlanner.jar]

If the version you have downloaded is the same as the version you’ve described, the installation must be successful and you have now a reference to your local JPlanner file in your maven project in Eclipse Net Beans.

Download a sample Scheduler project for NetBeans with Maven loading a local JPlanner.jar file

II. Java Application with Gradle

Choose a place in the directory of your Gradle project where you want to store the JPlanner.jar file. For our sample project we have chosen to create a new libs folder in the same directory where the src and build folders are located. We have copied the JPlanner.jar there. The build.gradle script is also located there. Since we have to edit it, we can easily specify the location of the JPlanner.jar relatively to the script location.

In NetBeans or directly from your hard drive, open the build.gradle script. In NetBeans it is located in the “Build Script” folder:

[Edit the build.gradle script in NetBeans]
Find the dependencies section and add the line that loads the JPlanner:

dependencies {

.....................................

implementation files('libs/JPlanner.jar')

}

This is the Groovin syntax. If you are using Kotlin your line should be:

implementation(files("libs/JPlanner.jar"))

If the location of your JPlanner.jar is specified correctly, the file should load successfully now and the scheduling namespaces should be accessible in your code.

Download a sample Scheduler project for NetBeans with Gradle loading a local JPlanner.jar file

III. Java Application with Ant

When you create a Java project with Ant you are asked to name the location of library files. The default is lib. Copy the JPlanner.jar into the folder that holds your library files. It appears in the project tree as “Libraries” though its name on the physical drive could be different.

Right-click the Libraries node in the project tree in NetBeans. Choose “Add JAR/Folder”.

[Add the JPlanner.jar in Ant]

Navigate to the folder where you have placed the JPlanner.jar and choose it. After that, you should be able to import the scheduling packages.

Download a sample Scheduler project for NetBeans with Ant loading a local JPlanner.jar file

If you need help using the Java Scheduler with NetBeans, please contact our support team at support@mindfusion.eu or write at the support forum.

About MindFusion Scheduling for Java Swing: The library provides extensive feature-set for creating and customizing all sorts of calendars, task lists, time-management tables, resource allocation tables and other. It boasts various options for customizing appearance and numerous events for handling user actions. The distribution archive includes a lot of samples and detailed documentation. Learn more at https://mindfusion.eu/java-scheduler.html



总数:1 页次:1/1 首页 尾页  
总数:1 页次:1/1 首页 尾页  


所在合集/目录



发表评论:
文本/html模式切换 插入图片 文本/html模式切换


附件:



NEWBT官方QQ群1: 276678893
可求档连环画,漫画;询问文本处理大师等软件使用技巧;求档softhub软件下载及使用技巧.
但不可"开车",严禁国家敏感话题,不可求档涉及版权的文档软件.
验证问题说明申请入群原因即可.

Copyright © 2005-2020 clq, All Rights Reserved
版权所有
桂ICP备15002303号-1