在Spring Boot嵌入式容器中部署第三方战争 [英] Deploying a third party war in a Spring Boot embedded container

查看:124
本文介绍了在Spring Boot嵌入式容器中部署第三方战争的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请原谅,如果这感觉有点坏死。我查看并发现这里只有一个类似的问题,没有任何答案( Spring-Boot Embedded Wars )。

Pardon if this feels a bit of "necroposting". I looked and found only one similar question with no answers here (Spring-Boot Embedded Wars).

我有一个打包到spring boot(1.0)容器中的服务。该服务使用activiti(www.activiti.org)来管理某些商务流程。我正在尝试在同一个spring boot容器中部署activiti-explorer之战。这场战争有其自己的web.inf,spring config等,因此它可能与现有的spring config发生冲突,但是尽管如此,我还是想按原样部署那场战争。

I have a service packaged into a spring boot (1.0) container. This service uses activiti (www.activiti.org) to manage some buisiness processes. I am trying to deploy inside the same spring boot container, the war for activiti-explorer. This war has its own web.inf, spring config, et cetera, so it may conflict with the existing spring config, but nonetheless, I'd like to try to deploy that war as it is.

我还没有找到任何方法可以做,并且怀疑spring boot不支持将预包装大战部署到嵌入式容器中,不是吗?

I haven't found any way to do that, and suspect that spring boot doesn't support the deployment of pre-package wars into the embedded container, isn't it?

仅作为警告,我认为我无法将提取的战争放入Spring-boot jar中,因为我认为它需要一个功能齐全的Web容器。如果spring-boot不提供此功能,没什么大不了的,我们将在那场雄猫上部署那场战争,但如果可能的话,将很方便。

Just as a warning, I think I can't put the extracted war into the spring-boot jar as I feel it needs a fully functional web container. If spring-boot doesn't offer this functionality, no big deal, we're going to deploy that war on its own tomcat, but it would be handy if it could be.

谢谢

更新
为了更清楚,我有一个已经运行了Spring Application独立服务器,并具有自己的嵌入式Tomcat。
在嵌入式Tomcat中,我插入了一些我开发的@Controllers。
然后,我还能够使用ServletRegistrationBean(映射到/ servlet-path)来映射第三方servlet。

Update Just to clear better, I have an already running Spring Application standalone server, with its own embedded Tomcat. Inside the embedded Tomcat I plugged some @Controllers I developed. Then I was also able to map a third-party servlet using a ServletRegistrationBean (mapped to /servlet-path).

现在我想做类似于另一场战争,其中包含完整的Web应用程序(这是具有自己的库,jsps,静态资源等的vaadin / spring 3.2应用程序),并希望将其映射到(例如)/ war-path。

Now I'd like to do something similar with another war that contains a full fledged web application (it's a vaadin/spring 3.2 application with its own libraries, jsps, static resources ...) and would like to map it to (say) /war-path.

我想将战争放在一个众所周知的位置,并使用一个(例如)WarRegistrationBean将其部署到tomcar中,从而让Tomcat处理所有的类加载障碍(如我所提到的,战争使用的是Spring 3.2,而我使用的是带有弹簧靴的4.0,...)。
我怀疑spring-boot或(甚至可能超出了项目本身的范围)不支持此最后一个功能。

I would like to drop the war in a well known location and deploy it into tomcar with a (say) WarRegistrationBean that would let Tomcat handle all the classloading hurdles (as I mentioned, the war is using spring 3.2 while I'm using 4.0 with spring boot, ...). I suspect that this last feature is not supported by spring-boot or - possibly - even out of scope for the project itself.

推荐答案

您可以通过添加启动插件做的事情(来自加载程序的类和一些META-INF信息)来手动增强战争存档。最简单的方法是简单地增强一场空战,然后将其与目标战合并(通过将它们同时爆炸并重新震撼)。您唯一需要添加的可能是主类。

You can manually enhance a war archive by adding the stuff that the boot plugin does (classes from the loader and some META-INF information). Easiest would be to simply enhance an "empty" war, and then merge it with the target one (by exploding them both and re-jarring). The only thing you'd need to add might be a main class.

在Boot工具中仍然存在差距。如果您认为需要填写,请提出问题和/或发送一些代码。

It's still a gap in the Boot tooling. If you think it needs filling please raise an issue and/or send some code.

这篇关于在Spring Boot嵌入式容器中部署第三方战争的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆