spring-boot - 使用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(合并代码)或任何其他更好的方法来解决它。
解决方案
推荐阅读
- datetime - How to get ordinal indicators (1st, 2nd, 3rd, etc) in Go
- swift - 在 NavigationBar 中将自定义视图添加到 PreferredLargeTitles
- c# - 如何解决 DbUpdateConcurrency 异常
- graph-theory - 图算法将图循环划分为具有 0 个输入边的块
- python - 在单个命令中获取视频裁剪部分的场景更改
- vb.net - 在 VB.Net 中存储数据表
- c# - 无效的线程操作,Invoke 方法不起作用
- angular - 在 AoT 编译的 Angular 应用程序中访问窗口属性
- python - 在python中的赋值错误之前引用的变量
- android - 在回收站视图中运行时遇到一些问题