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

Hi,
I run functional test in activeinstalls module:
xwiki-platform\xwiki-platform-core\xwiki-platform-activeinstalls\xwiki-platform-activeinstalls-test\xwiki-platform-activeinstalls-test-tests.

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?

Thanks.
Wuxia

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 start_xwiki.sh|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 start_xwiki_debug.sh|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.