buildship icon indicating copy to clipboard operation
buildship copied to clipboard

Gradle arguments containing spaces are not supported in project settings

Open CsCherrYY opened this issue 2 years ago • 1 comments

Steps to Reproduce

  1. git clone https://github.com/spring-projects/spring-petclinic
  2. open and import it in eclipse, the import process will be finished successfully
  3. 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: image
  4. apply and close, try to refresh (synchorize) the project
  5. you can find that the synchorize process failed with the following stacktrace: image
  6. after reopen the project properties, the arguments are splited automatically with space: image

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 :))

CsCherrYY avatar Sep 27 '22 02:09 CsCherrYY

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

rgrunber avatar Sep 27 '22 18:09 rgrunber