【发布时间】:2011-06-16 10:43:04
【问题描述】:
我正在从事一个相当大的项目。我们有很多项目,每个项目都有依赖关系。我们使用maven,通常我们没有任何问题。因此,在不提供太多细节的情况下,假设对于给定的项目,例如,tps-reports pom.xml 的依赖项部分如下所示:
<name>TPS-Reports</name>
<description>
TPS Reports frontend.
</description>
<dependencies>
<dependency>
<groupId>com.initech</groupId>
<artifactId>gui-components</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.initech</groupId>
<artifactId>multithreading</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>com.initech</groupId>
<artifactId>utils</artifactId>
<version>2.3.0.0</version>
</dependency>
<dependency>
<!-- TODO: update to new version -->
<groupId>com.initech</groupId>
<artifactId>object-pooling</artifactId>
<version>1.9.3.1</version>
</dependency>
</dependencies>
现在,Initech 拥有大量依赖于 object-pooling 的项目,这些项目还依赖于许多其他组件,例如(utils 和 multithreading)。
object-pooling 开发人员的生活是美好的。这是一个非常稳定的模块,一切顺利。与任何其他模块一样,它也具有依赖关系。 object-pooling 开发人员都是绅士淑女,每当他们发现严重错误时,他们都会更新所有依赖于 object-pooling 的项目。
现在,object-pooling 的版本 1.9.3.1 稳定,没有已知的严重错误。开发人员非常努力地添加大量新功能,一段时间后,他们发布了版本2.0.0.0。当然,在1.9.3.1 和2.0.0.0 之间,还有中间版本(例如1.9.3.1、1.9.3.2、1.9.4.0、1.9.5.3 等)。正如我所说,object-pooling 开发人员的生活是美好的。版本 2.0.0.0 具有新功能和大量修复。
但是,tps-reports 开发人员的地狱指日可待。他们已经使用1.9.3.1 有一段时间了,由于这个版本没有已知的错误,他们对旧版本感到满意。现在,他们想使用修改后的object-pooling,因此他们将pom.xml 更新为使用版本2.0.0.0,现在看起来像这样:
<name>TPS-Reports</name>
<description>
TPS Reports frontend.
</description>
<dependencies>
<dependency>
<groupId>com.initech</groupId>
<artifactId>gui-components</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>com.initech</groupId>
<artifactId>multithreading</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>com.initech</groupId>
<artifactId>utils</artifactId>
<version>2.3.0.0</version>
</dependency>
<dependency>
<!-- use object poooling's new features -->
<groupId>com.initech</groupId>
<artifactId>object-pooling</artifactId>
<version>2.0.0.0</version>
</dependency>
</dependencies>
他们发现他们有新的错误。不用说,当它们依赖于object-pooling 的版本1.9.3.1 时,这些错误并不存在。他们深入研究代码存储库的日志,发现不仅object-pooling 的人已经完成了数千次提交,而且他们使用的multithreading 和utils 的最新版本也有很多提交。
显然,问题可能存在于无数地方。可以在object-pooling上,可以在object-pooling和tps-reports的交互上,可以在multithreading或utils上,或者任何奇怪的组合。
问题是:你们如何解决这类问题?您如何管理对大项目的依赖关系,而这些大项目又依赖于其他项目?是否有一些工具可以帮助完成这项任务?
谢谢!
【问题讨论】:
标签: maven-2 build project-management dependencies maven