[GRADLE-3582] Gradle wrapper fails to escape arguments with nested quotes Created: 18/Nov/16  Updated: 23/Nov/16  Resolved: 18/Nov/16

Status: Resolved
Project: Gradle
Affects Version/s: 3.2
Fix Version/s: 3.2.1-rc-1, 3.2.1

Type: Bug
Reporter: Eric Wendelin Assignee: Unassigned
Resolution: Fixed Votes: 0

Known Issue Of:
3.2

 Description   

When passed an argument with nested quotes, such as `'-DFOO="bar < baz"'`, the Unix Gradle wrapper script from version 3.2 fails because it tries to pipe input from the `baz` file - the argument is not correctly escaped.

Expected Behavior
`./gradlew '-DFOO="bar < baz"'` should escape its arguments correctly when executing Gradle

Current Behavior
`./gradlew '-DFOO="bar < baz"'` fails with `No such file or directory` (assuming the `baz` file does not exist)

Context
This pattern of nested quotes is produced by Jenkins' Gradle integration, and it will always contain a `<` when triggered by Gerrit integration. Our continuous integration is broken by this bug.

Steps to Reproduce (for bugs)

Your Environment

  • Gradle Version: 3.2
  • Last worked correctly in: 3.1
  • Operating System: Arch Linux 64-bit
  • JVM version: OpenJDK 1.8.0_112


 Comments   
Comment by Eric Wendelin [ 18/Nov/16 ]

Resolved by https://github.com/gradle/gradle/commit/a171b72b0973ace7b1f9c17551654c0de1ca49e2

Generated at Wed Jun 30 12:52:32 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.