Running web app in both Jetty and Tomcat

后端 未结 4 1764
耶瑟儿~
耶瑟儿~ 2021-02-14 18:19

I have a web app which in production I run on Tomcat. It uses the MySQL connector, however it is not bundled up with the war, rather it is included under Tomcat\'s common lib di

4条回答
  •  旧时难觅i
    2021-02-14 18:52

    Perhaps you could try using Maven .war overlays for this purpose, though I don't know if they work with other dependencies.

    So basically your project would be

    parent
    |---- original-war
    |---- new-war
    

    Where your original-war project has the mysql dependency as provided but the the new-war module is just a pom that has a war, depends on the original war (for the overlay) has the mysql dependency with the compile scope, and runs the jetty plugin (leave the jetty plugin out of the original-war module). If this works, then you'll have to deal with the minor inconvenience of doing your development in one module but whatever testing you are doing in maven within another module.

提交回复
热议问题