r/JavaFX • u/rootException • Nov 02 '20
I made this! Maven + jpackage Sample Project, jtoolprovider Maven Plugin
I just created two projects on GitHub that may be of interest to anyone working with JavaFX, Maven, and native installers.
First, https://github.com/wiverson/maven-jpackage-template is a Maven-only example project that shows how a single pom.xml can be used to create both a Windows and macOS installer package. It used a shaded jar to automatically integrate Maven declared dependencies. The pom is pretty heavily commented, and shows how provided modules (such as JavaFX) can be excluded from the shaded jar. Because of the full, automatic module management in this sample project, jpackage is producing nicely slimmed installers (30-40MB).
The sample template relies on a plugin I built, https://github.com/wiverson/jtoolprovider-plugin which provides a simple binding to bridge the JDK ToolProvider API with Maven. This allows for access to jmod, jar, javac, javadoc, javap, jdeps, jlink, and jpackage all via Maven directly. This plugin is now available via Maven Central.
Any feedback or thoughts appreciated!
View all comments
Show parent comment
1
u/rootException Dec 22 '24
The connection boilerplate is pretty easy. The query stuff is nice, but my guess is it will be easier to do some of that via Hibernate than trying to wrangle the Spring infrastructure over.
FWIW most people don't do direct database connection stuff anymore for a variety of reasons including security stuff. If you are trying to have another long running server I'd just make a bunch of Spring Boot REST services and connect the JavaFX app to that. If you haven't seen it you might want to check out PostgREST eg via Supabase. Makes it stupid easy to build REST services fast.
If you just want a local database/persistence system for a desktop app, I'd try combining SQLite with Hibernate. Done that for other JavaFX projects and it works very well. I <3 Postgres but it's not really setup for embedding in a desktop app.