How to pass the -D additional parameter while starting tomcat?

后端 未结 6 581
慢半拍i
慢半拍i 2020-12-25 12:14

I have a maven project, after running command mvn install all project as well as module compile and copied to local repository successfully. But now I want

6条回答
  •  佛祖请我去吃肉
    2020-12-25 12:25

    I have tested params for Tomcat 7/8 on Windows 10 and CentOs 7 (Linux).
    1) On Windows need to create setenv.bat in the {TOMCAT_HOME}/bin/ path and insert there such code:

    set CATALINA_OPTS=-Dapp.username=admin -Dapp.password=12345
    

    IMPORTANT: do not use quotes (" ") for setting params on windows.

    2) On CentOs need to create setenv.sh in the {TOMCAT_HOME}/bin/ path and insert there such code:

    export CATALINA_OPTS="-Dapp.username=admin -Dapp.password=12345"
    

    You can also create {TOMCAT_HOME}/conf/conf.d/custom.conf and insert the same export command there.

提交回复
热议问题