首页 > 解决方案 > 使用spring boot合并websphere和wildfly的代码

问题描述

我有两个用于 websphere 和 wildfly 的代码库,它们具有相同的函数名称,只是一些 import 语句作为区别。例如对于 jax-rs wildfly

hello()
{
ResteasyClient client= new Client();
//some code(abcdef)
ResteasyWebtarget target=new Webtarget();
//some code(xyz)
}
for Websphere
hello(){
Client client=new Client();
//some code(same as above code abcdef)
Webtarget target=new Webtarget();
//some code(same as above code xyz)
}

同样,一切都是一样的,只是这个导入在每个函数中都不同,wildfly 和 websphere 的情况。我想合并两个代码库以获得一个。如何使用 spring boot 管理这个,当我在 application.properties 文件中选择一个环境作为 wildlfy 时,我可以只使用 wildfly pom 运行 wildfly 代码。在 pom.xml 中,我应用了 maven 配置文件,但是如果我激活 ibm 标签,代码会显示 wildfly 部分的错误,因为在 ibm activate 中没有 wildfly 依赖项。

有没有办法使用spring boot(合并代码)或任何其他更好的方法来解决它。

标签: spring-bootmavenwildflywebsphere-liberty

解决方案


推荐阅读