How to pass a jvm parameter to xwiki server when run functional test

I run functional test in activeinstalls module:

For that, I execute the cmd: mvn -f xwiki-platform-activeinstalls\xwiki-platform-activeinstalls-test\xwiki-platform-activeinstalls-test-tests\pom.xml

The functional test started a xwiki_server, it worked well.

My question is I want to add a JVM option parameter to XWIKI_Server for this functional test.
Where should I pass the JVM parameter to xwiki_server?


You shouldn’t need to pass anything. What’s your need?

XWiki is started by some bat/shell script. See the target/xwiki directory that’s been generated and fin the|bat file in there. Look inside and you’ll see what JVM params are used and what environment variable you can use. There’s also a|bat to start xwiki in JVM debug mode.

I pass jvm parameters in order to intrument xwiki_server to get some tracing logs.

I saw the target/xwiki/start_xwiki.bat script. I tried setting environment variables in start_xwiki.bat.
However, each time I run the functional test, this start_xwiki.bat is rewritten and my customized variable was gone.

How can I avoid this target/xwiki/start_xwiki.bat being rewritten, so that the change in xwiki_bat can be kept?

Thanks for your reply.

You can’t. The build generates it.

But again you shouldn’t need any change to this file normally. If you really want to change it, you should change it in xwiki-platform/xwiki-platform-tools/xwiki-platform-tool-jetty/xwiki-platform-tool-jetty-resources/src/main/resources at master · xwiki/xwiki-platform · GitHub and rebuild this module.

I have tried your solution.
It works well. :slight_smile:

Thanks a lot for your help.