chore: remove zt-exec dependency#24219
Conversation
The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes.
| Collections.emptyMap(), "build"); | ||
| } | ||
|
|
||
| // The declared TimeoutException is retained for source compatibility with |
There was a problem hiding this comment.
Shouldn't the throws be removed instead? It's a util class for our plugins
| Runtime.getRuntime().addShutdownHook(shutdownHook); | ||
|
|
||
| StringBuilder toolOutput = new StringBuilder(); | ||
| try (BufferedReader reader = new BufferedReader( |
There was a problem hiding this comment.
This looks like a util method that either exists in Java or in Flow. Files.readAllLines if it is not important to print while reading, something else otherwise
After removing `zt-exec`, the Vite runner still declared `throws TimeoutException` for source compatibility and drained the process output with a manual `BufferedReader` loop. Neither is needed for an internal plugin utility. Drop the unused throws clause (and its multi-catch in `BuildFrontendMojo`) and read the output via `Process.inputReader` plus `BufferedReader.lines().forEach`.
|
|
Hi @mcollovati and @mcollovati, when i performed cherry-pick to this commit to 25.0, i have encountered the following issue. Can you take a look and pick it manually? |
This PR cherry-picks changes from the original PR #24219 to branch 25.1. --- #### Original PR description > The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. > > Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes. > Co-authored-by: Marco Collovati <marco@vaadin.com>
The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes.
The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes.
The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes.
… 24.9) (#24237) This PR cherry-picks changes from the original PR #24224 to branch 24.9. --- #### Original PR description > The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. > > Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes. Co-authored-by: Marco Collovati <marco@vaadin.com>
…23.6) (#24238) This PR cherry-picks changes from the original PR #24228 to branch 23.6. --- #### Original PR description > The Maven plugin used `org.zeroturnaround:zt-exec` to launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath. > > Replace it with `java.lang.ProcessBuilder`, following the approach already used elsewhere in Flow for running external processes. Co-authored-by: Marco Collovati <marco@vaadin.com>



The Maven plugin used
org.zeroturnaround:zt-execto launch the Vite build process, adding an external dependency that had to be pinned on the plugin classpath.Replace it with
java.lang.ProcessBuilder, following the approach already used elsewhere in Flow for running external processes.