buildship
buildship copied to clipboard
Gradle arguments containing spaces are not supported in project settings
Steps to Reproduce
- git clone https://github.com/spring-projects/spring-petclinic
- open and import it in eclipse, the import process will be finished successfully
- add an init script in a folder with its name containing a space, and try to make it the init script in the project settings:
- apply and close, try to refresh (synchorize) the project
- you can find that the synchorize process failed with the following stacktrace:
- after reopen the project properties, the arguments are splited automatically with space:
This issue also affects VS Code extension redhat.java
which uses buildship as its Gradle integration.
Some findings
- it seems that buildship regards the part before the first space as a standalone part of the arguments
- it looks like if we set the workspace settings directly, there is no such issue, there might be some gap here
- I guess the root cause might be the arguments are joined directly with a single space: https://github.com/eclipse/buildship/blob/35d01caad3ab023fdd9fdf4a1b9e9c738bff7fd0/org.eclipse.buildship.core/src/main/java/org/eclipse/buildship/core/internal/configuration/BuildConfigurationPersistence.java#L166 (but why the workspace setting works well :))
I was able to reproduce the same behaviour on Linux :
Version: 2022-09 (4.25)
Build id: I20220831-1800
Buildship: Eclipse Plug-ins for Gradle 3.1.6.v20220511-1359 org.eclipse.buildship.feature.group Eclipse Buildship