Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Including the org.beryx.runtime plugin overrides the defaultJvmOpts in every CreateStartScripts-based task #128

Open
pspeed42 opened this issue Jun 4, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@pspeed42
Copy link

pspeed42 commented Jun 4, 2022

In my application build, I have a CreateStartScripts task for creating a separate start script (for running my app on older JVMs) and I include this in my distZip version of the application. This CreateStartScripts task has customized defaultJvmOpts for running on the older version of Java. Normally that all works fine.

However, as soon as I simply include the beryx.runtime plugin:

plugins {
    id 'org.beryx.runtime' version '1.12.7'
}

...without even configuring anything...
The defaultJvmOpts get overridden with whatever is in applicationDefaultJvmArgs.

This is suboptimal.

My goal is to build platform specific JVM+app bundles with your plugin but also to still build a distZip for "other" platforms. At this point, the only way I can make that work is to use two different build files, one with your plugin included and the other without.

Thanks for your consideration.

Version information in case it matters:

------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18 (Oracle Corporation 18+36-2087)
OS:           Windows 7 6.1 amd64
@hakanai
Copy link
Collaborator

hakanai commented Jan 15, 2023

This issue is at around this point:

project.tasks.withType(CreateStartScripts) { CreateStartScripts startScriptTask ->

The configuration gets applied to all CreateStartScripts tasks, I'm guessing under the assumption that all such tasks will be for launching the application, an assumption which turns out to be false if you use that task for other things.

I haven't figured out what the fix would be, but we'd need some way to distinguish the tasks we do want to apply it to, from the ones we don't. Maybe even looking at the name of the task?

@hakanai hakanai added the bug Something isn't working label Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants