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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

jvmFlags.add throws UnsupportedOperationException in gradle jib plugin #4222

Open
pavlovicaleksandar opened this issue Mar 29, 2024 · 0 comments

Comments

@pavlovicaleksandar
Copy link

Hi awesome people who are working on this, this is not a blocker but something I thought would be nice for you to know 馃槃

Description of the issue:
Bumping gradle jib plugin from version 4.3.1. to 4.4.1 was actually breaking change as it is not possible to add jvmFlags anymore after they have been initialized. We've find solution for it - we just create temporary list and assign flags at the end but still wanted to let you know about it. We use it in kotlin backend project.

  • Jib version: 4.4.1
  • Build tool: Gradle 8.5
  • OS: macOS
  • java (jvm target): 21
  • kotlin: 1.9.23

Expected behavior:
Bumping non-major version is not introducing breaking changes

Steps to reproduce:

  1. initialize jvmFlags with mutableList
  2. try to execute jvmFlags.add to add more flags and it will throw java.lang.UnsupportedOperationException (no error message) and report it on line you are trying to do jvmFlags.add

jib-gradle-plugin Configuration:
I've pasted just small example what would break it

container {
      .
      .
      jvmFlags = mutableListOf("some flags")
      if (something) {
        jvmFlags.add("new flag")
      }
      .
      .
    }

Log output:
java.lang.UnsupportedOperationException (no error message) at line where jvmFlags.add is called

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants