testing - Howto pass Java system properties to maven-cargo container -


I am preparing a maven2 web project for continuous integration.

My code depends on some system properties which are set with MAVEN_OPTS = -Dfoo = bar . Unfortunately these properties are unavailable when the application is deployed in a TOKTOM:

  System.getProperty ("foo"); How can I pass these properties in Tomcat?   

You should be able to do this by using the System Properties tag in the container definition of plug-ins: / P>

  & lt; Container & gt; [...] & lt; SystemProperties & gt; & Lt; MAVEN_OPTS & gt; -Dfoo = Bar & lt; / MAVEN_OPTS & gt; & Lt; / SystemProperties & gt; & Lt; / Container & gt;  

Or you can set it to $ cATALINA_HOME / bin / directory in setenv.sh (on Linux) file. If this file is not present, then you should create it and add the following line:

  MAVEN_OPTS = -Dfoo = bar  

Hope this helps Does.


Comments