1

I am running a puppet manifest with the following Exec:

exec {"mvn-project" :
    command => "maven.bat C:\\src\\project -Dmaven.test.skip=true",
}

the "=" sign is replaced with whitespace, resulting in the batch file being called as such:

maven.bat C:\\src\\project -Dmaven.test.skip true

I have tried encoding as unicode, but this does not seem to help.

Any explanation for this?

I am running puppet 3.8.1

  • Literal strings should have single quotes so that puppet doesn't try to parse it for variables. https://docs.puppetlabs.com/puppet/latest/reference/lang_data_string.html#single-quoted-strings – mgor Sep 12 '15 at 07:52
  • To place the blame where it belongs, it's legacy DOS behavior, not a Puppet specific problem. See https://support.microsoft.com/en-us/kb/35938 – MaxVT Sep 12 '15 at 18:58

1 Answers1

2

Apparantly it helps surrounding in double quotes. So, for the command to be correctly parsed, it must be written as:

exec {"mvn-project" :
    command => "maven.bat C:\\src\\project \"-Dmaven.test.skip=true\"",
}

Remember that in your .bat script, you must remove quotes using %~3