简体   繁体   English

使用不兼容的更改维护同一库的多个版本

[英]Maintaining multiple versions of the same library with incompatible changes

Ours a complex enterprise app and we use one third party library which we would like upgrade.But we do want to maintain two versions atleast for couple of releases till we are good with the newer version and switch which version to use by a configuration property. 我们是一个复杂的企业应用程序,我们使用一个要升级的第三方库,但是我们确实希望至少保留两个版本来发布几个版本,直到我们适应较新的版本并通过配置属性切换要使用的版本为止。

We are trying maven shading for the same. 我们正在尝试对Maven进行着色。

However the problem we are facing is like this. 但是我们面临的问题就是这样。 The changes between the two releases are very drastic. 两个版本之间的更改非常激烈。 For example A is a class in version 1.0 and is now an interface in version 2.0 例如,A是版本1.0中的类,现在是版本2.0中的接口

So let us say for example in the existing client code we say A a = new A(); 例如,在现有的客户端代码中,我们说A a = new A(); This would have to be changed to some other call in the new version. 在新版本中,必须将其更改为其他调用。

Are there any ideas on how to make the client code compatible with both the versions? 是否有关于如何使客户端代码与两个版本兼容的想法?

I don't believe there is a way to write code compatible with both the versions. 不相信有一种方法可以编写与两个版本兼容的代码。

Keeping multiple versions of same jar may create maintenance nightmares. 保持同一jar的多个版本可能会造成维护方面的噩梦。

I suggest to create/maintain separate SVN branches for each version of this jar. 我建议为该jar的每个版本创建/维护单独的SVN分支

You can decide which SVN branch should go into production based on maturity of that branch. 您可以根据该分支的成熟度决定哪个SVN分支应投入生产。

You can simply replace the war from other branch , if any issue during deployment/in production. 如果在部署/生产过程中出现任何问题,您可以简单地替换其他分支的战争

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM