Search code examples
buildr

Need help passing arguments via Buildr


I am a newbie to Buildr(Apache Buildr), I am trying to run a junit test using buildr but I am not sure how to pass the arguments like -Djava.awt.headless=true etc..

I tried something like below, but doesn't seem to work

  test.using( :java_args => ['-Djava.awt.headless:true'])

I am not sure if I need to pass this to system properties or JVM arguments, can someone help?


Solution

  • This is the right way but there's a small typo in your :java_args, it should be:

    test.using :java_args => [ '-Djava.awt.headless=true' ]
    

    (notice the equal sign after headless versus a colon in your question.)

    There is also a more concise/foolproof way of passing properties using a hash of property names and values,

    test.using :properties => { "java.awt.headless" => "true" }