0

We are trying to use ${server.config.dir} in jvmOptions

-Djava.security.auth.login.config=${server.config.dir}/kerberos/client_jaas.conf

Can we set this as part of Jenkins environment variables?

We did it like this-

environment {
        server.config.dir="some directory"
}

and we are getting this error-

WorkflowScript: 37: Expected string literal @ line 37, column 9.
           server.conf.dir="serverconfigdir"
           ^

1 Answers1

1

The error message indicates a string literal is expected, and the special characters are causing the compiler to not read the key in the environment directive as a string literal. You need to explicitly cast it as a literal string:

environment {
  'server.config.dir' = "some directory"
}

and the error will be fixed.

Matthew Schuchard
  • 25,172
  • 3
  • 47
  • 67