I am using a library and I need to pass some VM parameters on launch (e.g.
java -Dcom.kgasoft.param=true -jar mysoftware.jar). I had some unit tests on Jenkins and they failed, because I wasn’t able to pass these VM params.


I tried some Jenkins plugins, but I wasn’t able to achieve the required result. As it turns out I could use surefire plugin’s parameters. So, assuming we use Maven, in my pom file I specified the following in the
builds/plugins
section:

This did the trick and the unit tests now pass!

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url=""> 

required

Page last modified: 06:46 on November 6, 2013 (UTC+2)