Giter Site home page Giter Site logo

javafx-maven-boilerplate's Introduction

JavaFX Maven boilerplate

Maven boilerplate project for creating native JavaFX desktop apps with reasonable defaults.

alt

Features

  • Multi-module project structure
  • Includes some plugins and dependencies you'll probably need anyway. Just make sure you're using the latest versions
  • Includes basic assets structure (fonts, styles and themes), so you won't need to waste your time on this either
  • Produces:
    • portable cross-platform artifact, namely Java application image
    • Windows exe and msi installers
    • Linux AppImage plus deb and rpm installers
  • Doesn't require to store any platform specific artifacts in repository
  • Release notes from changelog generation

Generated app size is around 60Mb, installers ~40Mb. It directly depends on how many modules you're using. Check jlink options to shrink image size even more.

Requirements

  • Java 17+, feel free to bump Java version when its out
  • Maven 3.6+ or use bundled Maven wrapper for demo purposes
  • For local build:

Local build

To generate everything but native installers:

mvn clean package

To create a new release:

mvn clean install

To run the app:

# omit java.home if OS Java version is the same as project Java version
# more explanation in pom.xml
mvn javafx:run -Djava.home=<path-to-jdk>

To run the app in debug mode:

mvn javafx:run@debug

After that use you IDE to connect to the JVM via run configuration for remote debugging. Default port is 9090.

Github Actions

To issue a new release create a tag that matches v* and push it into remote repository. Check the workflow for details. Note that it uses your changelog to generate release notes, so don't forget to update it.

Also don't forget to update the workflow if you want to rename the desktop module.

FAQ

Why not Maven archetype?

Because it's easier to maintain a template as an ordinary project you can run and experiment with. Maven archetypes is good for bootstrapping but you can also use Bash to rename a project:

find . -depth -type f -regex ".*\.\(xml\|java\)$" -exec sed -i -e 's/boilerplate/myrootpackagename/g' {} \;
find . -depth -type d -name 'boilerplate' -execdir rename 's/boilerplate/myrootpackagename/' '{}' \+

Can I use not modularized dependencies?

Absolutely. You have two options. Either inject module-info.java into existing library by using Moditect Maven plugin. You can find an example here. Or use pre-packaged dependencies from GuicedEE project.

macOS dmg support?

Not planned.

javafx-maven-boilerplate's People

Contributors

mkpaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.