Netbeans 10(带有Maven)中的JavaFX 11没有源/Javadocs [英] JavaFX 11 in Netbeans 10 (with Maven) has no Sources/Javadocs

查看:107
本文介绍了Netbeans 10(带有Maven)中的JavaFX 11没有源/Javadocs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了适用于Maven的NetBeans JavaFX教程,并使其运行没问题. Maven找到了工件,下载了它们,构建了项目并启动了它.但是我没有代码完成(缺少源代码和Javadocs).

I tried out the JavaFX tutorial for Netbeans with Maven and got it running without a problem. Maven found the artifacts, downloaded them, build the project and started it. But I get no code completion (Missing sources and Javadocs).

我尝试下载Netbeans中的Maven依赖项的源代码和javadocs,但是仅包装器工件(例如空的javafx-controls-11)的源代码/javadocs可用.但是找不到实际实现的资源(例如javafx-controls-11-linux).

I tried to download the sources and javadocs for the maven dependencies in Netbeans, but only the sources/javadocs for the wrapper artifacts (e.g. the empty javafx-controls-11) are available. But no sources are found for the actual implementation (e.g. javafx-controls-11-linux).

在哪里可以找到源代码/javadocs,以及如何将它们添加到Netbeans?

Where do I find the sources/javadocs and how do I add them to Netbeans?

推荐答案

有一个问题已经在OpenJFX文档中对此进行了归档.

There is an issue already filed about this at the OpenJFX docs.

虽然尚未解决,但是有一种可能的解决方法,基于:

While it hasn't been resolved yet, there is a possible workaround, based on:

NetBeans仅为名称完全相同且后缀为-javadoc/-source的罐子添加Javadoc/source罐子

NetBeans only adds javadoc/source jars for a jar with the exact same name and -javadoc/-source suffix

因此,以下是解决此问题的步骤:

So here are the steps to solve it:

  • 安装NetBeans 10 和JDK 克隆HelloFX 样本对于NetBeans和Maven,来自OpenJFX示例.

    Clone the HelloFX sample for NetBeans and Maven, from the OpenJFX samples.

    将JavaFX依赖项更新为11.0.2.

    Update the JavaFX dependencies to 11.0.2.

    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-controls</artifactId>
        <version>11.0.2</version>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-fxml</artifactId>
        <version>11.0.2</version>
    </dependency>
    

  • 运行它:

  • Run it:

    mvn clean compile exec:java
    

  • 检查JavaFX依赖项是否已下载到本地m2存储库.例如,在<user home>/.m2/repository/org/openjfx/javafx-base/11.0.2下,您会找到javafx-base-11.0.2.jarjavafx-base-mac-11.0.2.jar(或winlinux取决于您的平台).

  • Check that the JavaFX dependencies have been downloaded to your local m2 repository. Under <user home>/.m2/repository/org/openjfx/javafx-base/11.0.2 for instance you will find javafx-base-11.0.2.jar and javafx-base-mac-11.0.2.jar (or win, or linux based on your platform).

    返回到NetBeans,右键单击Dependencies文件夹,然后选择Download Sources(请参见右下方任务栏中的任务进度),然后选择Download Javadoc(请参见任务进度).

    Back on NetBeans, right click in the Dependencies folder and select Download Sources (see the task progress in the bottom right taskbar), and then Download Javadoc(see the task progress).

    • 转到您的m2存储库,并验证现在是否存在-source-javadoc jar文件.
    • Go to your m2 repository and verify that there are now -source and -javadoc jar files.

    但是,这还不能解决问题,还有一个额外的步骤:

    However, this won't solve the issue yet, there is an extra step:

    • m2存储库中,使用平台分类器将-source-javadoc jar文件手动重命名为-mac-source-mac-javadoc(或winlinux(基于您的平台)) .对不同的JavaFX模块执行此操作:
    • In your m2 repository, manually rename the -source and -javadoc jar files using your platform classifier, to -mac-source and -mac-javadoc (or win, or linux based on your platform). Do this for the different JavaFX modules:

    返回NetBeans,检查是否已拥有JavaDoc,或者如果按Ctrl/CMD +单击,则可以访问源.

    Back to NetBeans, check that now you have JavaDoc, or if you press Ctrl/CMD+Click you can access the source.

    请注意,此修复程序仅需执行一次,其余Maven项目应选择JavaDoc和Sources.

    Note that this fix has to be done only once, the rest of your Maven projects should pick JavaDoc and Sources.

    这篇关于Netbeans 10(带有Maven)中的JavaFX 11没有源/Javadocs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆