I experienced a weird Jenkins error while trying to run a groovy-scripted pipeline that contained backslashes inside comments.
Here is the offending code:
// The script below depends on:
// * The presence of a recent nuget.exe in c:\tools (v5.7)
// * The presence of the xxx plugin installed for user foo\username
I'm aware the backslash is used in many languages to start an escape sequence, but I had never before experienced backslashes being an issue inside comments.
I wonder if this backslash in comments behavior is due to Groovy itself or rather a bug in the way Jenkins interprets it...
Edit: I solved my issue by replacing the offending \
with \\
but then noticed I had forgotten to double the backslash in c:\tools
, and still Jenkins did not complain. It seems Jenkins (or Groovy) tried to interpret the \u
in foo\username
as introducing an hex character code... but was okay with \t
for it probably was interpreted as a tab!