setup-java icon indicating copy to clipboard operation
setup-java copied to clipboard

fix: Maven Toolchains grows unexpectedly

Open Okeanos opened this issue 1 year ago • 1 comments

Description: On self-hosted runners toolchains.xml may survive multiple runs and unexpectedly grow as a result of the toolchains setup simply appending the JDK definition even if one with the same type and provides.id already exists.

Restructuring the parsing step and filtering the potentially existing list of toolchain definitions prevents this and also fixes toolchain.xml files that already contain duplicates.

There is one open TODO concerning the recreation of the toolchains-root node in the xml if an existing toolchains.xml was parsed. That could and potentially should be handled better and I am open to suggestions.

Related issue: #530

Check list:

  • [ ] Mark if documentation changes are required.
  • [x] Mark if tests were added or updated to cover the changes.

Okeanos avatar Sep 19 '23 22:09 Okeanos

Hey guys, this is a potential fix for my case. I would appreciate if we can test this out or merged it.

fpiresca avatar May 28 '24 19:05 fpiresca