Quoting and escaping in Maven Exec plugin -
how quoting , escaping work parameters passed maven plugins?
for example want pass multiple filenames arguments application run maven exec plugin:
mvndebug exec:java -dexec.mainclass="main" -dexec.args="/path/to/file1 /path/to/file2"
but if paths have spaces?
i've tried using \":
-dexec.args="\"/path/to/a file\" /path/to/file2"
and "":
-dexec.args="""/path/to/a file"" /path/to/file2"
neither works :-(. neither moving first quote before -d.
the source code maven exec plugin doesn't me either, receives string[] somewhere, where?
note must work command line, without changes pom file.
you try single quotes ('
) doubt work, either.
the problem can have several argument
elements inside pom (hence array in plugin's source) have single property command line.
options:
patch plugin and/or open feature request support several arguments (maybe
exec.args.0, exec.args.1, exec.args.2, ...
)create module depends on project/module , can change pom
use ant or bash script. use approach collect useful commands aren't supported maven.
mvn dependency:build-classpath -dmdep.outputfile=...
give classpath in case.
Comments
Post a Comment