Removing double quotes in exec java in Maven when executed via command line

I am trying to execute the maven exec command as follows:

mvn exec: java -Dexec.args = "{\" parameters \ ": [{\" name \ ": \" parameter1 \ ", \" value \ ": \" 1 \ "}]}"

A statement is a JSON string that I need to process in my Java program. But when the string is read by the Java class, double quotes are removed and read as: {Parameters: [{name: parameter1, value: 1}]}

I tried different escape sequences like \ and \\, but this does not work. I need to keep double quotes in a string.

Can someone please help me solve this.

+7
maven
source share
1 answer

try using " instead "(double quotes)

0
source share

All Articles