Ant, jvmarg, system properties and quotes

前端 未结 1 659
长发绾君心
长发绾君心 2020-12-30 06:06

We have a property which contains a series of arguments to be passed to the JVM in an Ant script.

Example (note the quotes in the second entry):

-Dsq         


        
相关标签:
1条回答
  • 2020-12-30 06:44

    I use <jvmarg> with single value

     <jvmarg value="-ea"/>
     <jvmarg value="-Dapp.URL=URL=${jvmargs}"/>
    

    Then this called with following line...

     ant tests -Djvmargs=\'jdbc:oracle:thin:@//192.168.56.42:1521/xe\':User=user:Password=password -debug
    

    The output with -debug has lines expected by you.

     [junit] '-ea'
     [junit] '-Dapp.URL=URL='jdbc:oracle:thin:@//192.168.56.42:1521/xe':User=user:Password=password'
    

    The line is meant to process arguments separated with space. It could be doing additional parsing and processing to handle input with whitespace. I have not checked the code yet.

    0 讨论(0)
提交回复
热议问题