beryx / badass-jlink-plugin

Create a custom runtime image of your modular application
https://badass-jlink-plugin.beryx.org
Apache License 2.0
382 stars 27 forks source link

release Java 23 compatible version #275

Open xzel23 opened 1 month ago

xzel23 commented 1 month ago

The Plugin currently (version 3.0.1) fails to work on projects with JDK 23. There's already an unmerged PR that addresses this: https://github.com/beryx/badass-jlink-plugin/pull/271

I add this new issue to describe a workaround until a new version is released.

Workaround until new plugin version is released

NOTE: This only works when using the plugin on your local machine, so it is rather a "works-for-me" hack than a general solution.

  1. Check out the plugin code and apply the PR mentioned above.
  2. Change the plugin version (I used 3.0.2).
  3. build using ./gradlew build publishToMavenLocal publishJlinkPluginMarkerMavenPublicationToMavenLocal publishPluginMavenPublicationToMavenLocal (I am not sure if the latter two targets are really necessary)
  4. Create/edit your ~/.gradle/init.gradle to contain the following text:
    settingsEvaluated { settings ->
    settings.pluginManagement {
        repositories {
            mavenLocal()
            gradlePluginPortal()
        }
    }
    }
    gradle.settingsEvaluated { settings ->
    settings.buildscript.repositories {
        mavenLocal()
        mavenCentral()
        gradlePluginPortal()
    }
    }
  5. Update the plugin version in the project you want to use the patched plugin in
xzel23 commented 1 month ago

Sorry. I used the wrong filename. It's not ~/.gradle/gradle.init but ~/.gradle/init.gradle. Corrected it in the workaround description.

CodeDead commented 21 hours ago

Hi @xzel23 , thanks for your patch and for keeping this plugin alive single handed! I've added your fork repository to the credits of my app!

https://github.com/CodeDead/opal/tree/development?tab=readme-ov-file#dependencies

xzel23 commented 1 hour ago

Thank you too. Actually I think we will see an updated version of the original plugin soon. Stay tuned!