简体   繁体   English

我可以在tomcat 7中在战争之外配置特定于应用程序的classpath目录吗?

[英]Can I have an application specific classpath directory in tomcat 7, configured outside the war?

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). 我想在tomcat 7中有一个附加的classpath目录,例如可以通过在catalina.properties中添加${catalina.home}/mydir来完成,但是特定于应用程序(战争)。

I would also like this setting to be outside the war (I found this SO question , but the configuration is within the war). 我还希望此设置不在战争范围内(我发现了这个SO问题 ,但配置在战争范围内)。

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. 谢谢。

VirtualWebappLoader https://stackoverflow.com/a/6410589/173149 : 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 $PREFIX is context of your application. 该配置可以放在$CATALINF_ROOT/config/Catalina/localhost/$PREFIX.xml ,其中$PREFIX是应用程序的上下文。 Use ROOT to place at / 使用ROOT放置在/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Tomcat JDBC 在服务器上配置并包含在应用程序 WAR 中 - Tomcat JDBC configured on Server and included in Application WAR 可以为每个war文件的gzip配置Tomcat吗? - Can Tomcat be configured for gzip per war file? 我在Tomcat文件夹中没有catalina目录。 在这种情况下,我在哪里可以找到应用程序特定的context.xml文件? - I do not have the catalina directory in the Tomcat folder. In this case where can i find application specific context.xml file? 我可以在Tomcat中基于每个应用程序创建自定义类路径 - Can I create a custom classpath on a per application basis in Tomcat 一台Apache Tomcat应用程序服务器,具有2个配置的war应用程序和一个MessageSource异常 - One Apache Tomcat application server with 2 configured war applications and a MessageSource exception 如何在Tomcat中定义特定于应用程序的类路径? - How to define application specific classpath in Tomcat? 可以在 Eclipse 之外的 tomcat 中部署 war,但不能在 Eclipse 中的 Tomcat 中部署战争 - Can deploy war in tomcat outside Eclipse but cant in Tomcat in Eclipse 我可以在.war文件中包含可修改的Java文件吗? (但仍连接到.war项目) - Can I have a modifiable Java file outside in a .war file? (but still connected to the .war project) 我可以在 tomcat 中放置手动提取的战争,而不是 deployOnStartup=true。 是否已经在 tomcat 中提取了战争文件 - Can i place a manually extracted war in tomcat instead of deployOnStartup=true. Is it proper to have already extracted war files in tomcat 在 spring 引导中的 WAR 打包期间会发生什么? 对于单个应用程序,我们可以同时拥有外部 Tomcat 和嵌入式 Tomcat 吗? - What happens during WAR packaging in spring boot? Can we have both external Tomcat and Embedded Tomcat for a single application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM