1

I would like to have an additional classpath directory in tomcat 7, like what can be done by adding ${catalina.home}/mydir in catalina.properties, but specific to an application (war).

I would also like this setting to be outside the war (I found this SO question, but the configuration is within the war).

I my case, it is to have two environments (say integration and QA) on the same container, with different configurations. I wish to keep the artifacts environment agnostic, so not changing the path to the configuration files (properties, logback, ...).

Can this be done ? How ?

Thank you.

Community
  • 1
  • 1
Raphaël Lemaire
  • 1,269
  • 1
  • 13
  • 23

1 Answers1

0

VirtualWebappLoader https://stackoverflow.com/a/6410589/173149:

<?xml version="1.0" encoding="UTF-8"?>

<Context antiJARLocking="true" path="/websandbox">
    <Loader className="org.apache.catalina.loader.VirtualWebappLoader"
          virtualClasspath="/usr/.../*.jar;/usr/.../*.jar"/>
</Context>

This config can be placed in $CATALINF_ROOT/config/Catalina/localhost/$PREFIX.xml where $PREFIXis context of your application. Use ROOT to place at /

Community
  • 1
  • 1
gavenkoa
  • 45,285
  • 19
  • 251
  • 303