setup-java
setup-java copied to clipboard
fix: Maven Toolchains grows unexpectedly
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.
Hey guys, this is a potential fix for my case. I would appreciate if we can test this out or merged it.