关于Maven项目的Resin4配置

    resin4运行Maven项目,这个是目前试用的最顺手的一个配置方式。只有更改pom.xml才需要重新package.

 
  <cluster id="app">
    <!-- define the servers in the cluster -->
    <server-multi address-list="${app_servers}" id-prefix="app-" port="6800"/>
 
    <host-default>
      <!-- creates the webapps directory for .war expansion -->
      <dependency-check-interval>2s</dependency-check-interval>
      <web-app-deploy expand-preserve-fileset="WEB-INF/work/**" multiversion-routing="${webapp_multiversion_routing}" path="webapps" path-suffix="${elastic_webapp?resin.id:''}" startup-mode="lazy"/>
    </host-default>
 
    <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import optional="true" path="host.xml"/>
      </host-default>
    </host-deploy>
 
    <!-- the default host, matching any host name -->
    <host id="" root-directory="${app.home}">
 
        <web-app id="/" root-directory="${app.home}\src\main\webapp">
            <!--  configurate web directory -->
            <prologue>
                <class-loader>
                <compiling-loader path="${app.home}\target\classes" />
                    <!-- configurate class directory -->
                    <library-loader path="${app.home}\target\${app.name}\WEB-INF\lib" />
                <!-- configurate library directory -->
                </class-loader>
            </prologue>
        </web-app>
    </host>
     
    <resin:if test="${resin_doc}">
      <host id="${resin_doc_host}" root-directory="${resin_doc_host}">
        <web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
      </host>
    </resin:if>
  </cluster>

app.home为maven项目根目录

app.name为maven项目构建后的名字

源文档 <http://www.kankanews.com/ICkengine/archives/35523.shtml>

优点:基本上达到了只用Maven构建一次(pom文件不修改的情况下)就可以自动加载修改过的jsp和资源文件(js、css等)

缺点:不能像tomcat那样,可以用Maven命令一次性完成构建,启动等工作。也就是说,Resin启动必须手动执行

转载于:https://my.oschina.net/u/574353/blog/336924

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值