How to build and publish to local maven a debug version of OpenJFX?

The stock releases of OpenJFX have the debug information removed from the builds. More times than not, I find myself in the depths of FX in my debugger, but it’s less useful because the information has been removed.

I have been looking at this page https://wiki.openjdk.org/display/OpenJFX/Building+OpenJFX and have downloaded and successfully built the trunk of OpenJFX on my MacOS machine, using JDK 21. And by “successfully”, I mean the build seems to complete without errors. I did this by simply running “sh gradelw”.

According the gradle.properties.template, the debug build is the default build. I copied the template to gradle.properties, and change the CONF setting to Release, and compared the class files. They are, indeed, smaller, which suggests the debug data is not being generated for release, helping confirm that the default build has the debug information.

On the web page, there is a long list of tasks, including publication tasks. Notably one named ‘publishToMavenLocal’.

When I run ‘sh gradlew tasks –all’, none of the publication tasks show up.

I would like to push this build to maven, so I can change my pom file to use the debug build in order to get better information when debugging my FX projects.

How can I properly publish the build artifacts for OpenJFX to my local Maven repository?

Addenda:

“Variable information not available, source compiled without -g option”. That’s what I get in my IDE when I’m stepping into FX code. So, I can’t view local variables in methods, just the parameters and class variables. This happens with 22.0.2.

The OpenJFX build for “release”, they use -g:source,lines and for “debug”, they use -g:source,lines,vars.

I simply want to deploy the debug artifacts to local .m2 Maven repo.

10

NetBeans supports source level debugging; in this case, the goal is to target the artifacts from building OpenJFX from source. A critical element is ensuring that NetBeans has access to the relevant source artifact. Without this, NetBeans may balk or display a decompiled listing; with it, stepping in and out of code is relatively painless. While this answer isn’t a complete solution, it may offer a way forward.

Maven Project

A maven project, illustrated here, is convenient in that you can right-click on the desired project dependency to download available sources. As yours are local, you may need to resort to the Apache Guide to installing 3rd party JARs.

Alternatively, consider building a Custom JDK+JavaFX Image using the artifacts as built. The resulting run-time image can be added as a distinct NetBeans platform in Tools > Java Platforms.

Ant Library Project

An ant project, illustrated here, offers the advantage of targeting the artifacts in a library, seen here. Simply add the relevant file or folder to the corresponding Classpath, Sources or Javadoc tab.

The typical SDK download includes a file named src.zip; it may appear among your build artifacts. This file is a composite of each module’s Javadoc. Simply adding src.zip to the Sources tab appears to be insufficient. With reference to NetBeans URIs and URLs, you may need to edit the library’s xml directly to access the archive’s internal structure:

<resource>jar:file:/…/lib/javafx-sdk-21.0.4/src.zip!/javafx.base/</resource>
<resource>jar:file:/…/lib/javafx-sdk-21.0.4/src.zip!/javafx.controls/</resource>
…

The file location is platform-dependent; MacOS is shown:

~/Library/Application Support/NetBeans/22/
    config/org-netbeans-api-project-libraries/Libraries/JFX.xml

So, my solution to this, in the end, was to just hand craft my own entries in .m2.

I went and grabbed a source release that I think matches the version I’m using (22.0.2 in this case). I then built it using sh gradlew.sh. This creates a full debug build by default. It puts all of the jars in the build/publications directory.

In publications, there’s no source jar, no javadoc jar. Just code jars.

Fine.

So I then donned a caving helmet, turned the light on, and clawed my way down into the .m2/repository/org/openjfx directory.

There are all the different artifacts. Specifically for my use case, I was interested in javafx-base, javafx-graphics, and javafx-controls. Also note there’s a parent javafx artifact as well.

Each of these directories contain, among others, a 22.0.2 directory. Which is the version I was using.

I went into each of those artifact directories, and created a 22x directory as a sibling to 22.0.2. I then copied the contents of the respective 22.0.2 files into the 22x directory. Now, all of these directories contained the code, javadoc, and source jars for each artifact. (Save for the javafx directory which is just a pom file, essentially.)

I then proceeded to copy the appropriate jar files out of the publications directory into their respective places, overwriting the original 22.0.2 jar files.

Next, I renamed all of the 22.0.2 files to 22x files. I then updated all of the poms to reference 22x instead of 22.0.2. Finally, I removed all of the sha1 files.

Once that was all done, I went to my project, updated my pom to 22x, rebuilt it, launched it in debug mode, stepped into JavaFX code, and, et voilà, it worked. There were my local variables.

Then, I turned off my light and took my caving helmet off.

I’d like to argue that I shouldn’t have had to do all this, since the project apparently makes regular releases to maven. I’d prefer to just use their tooling, but this was expeditious.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật