Definitely set up a repository. If you are a Maven-hater check out Gradle, it uses Ivy. Maven has a reputation for being complex but it does have better tool support. IDEs support Maven either out-of-the-box or with plugins, they give you graphs showing what the jars in your project depend on, so you can see conflicts easily.
Either Ivy or Maven will sort out your dependencies so your projects are using the right versions. Each of your projects should list (in the pom.xml for Maven) what version of which of your common libraries that it uses.
大多数版本控制系统的一个共同特征是使用外部分支。通用软件从共享存储库中获取,并在更新时集成到每个项目中。 一个关键的困难在于对通用软件的公共 API 的文档更改,我看到了两种解决方案:已弃用签名的良好沟通和持续集成,其中找出已弃用的方法可能会很痛苦。
A common feature of most version control systems is the use of external branches. Common software is fetched from a shared repository and integrated in each project on update. A key difficulty lies in documentation changes to the public API of common software and I see two solutions : good communication of deprecated signatures adn continuous integration where finding out deprecated methods can prove painfull.
管理方法签名更改的方法是遵循通用版本约定,因此当您执行主要版本时如果版本号增加,则可以说依赖代码必须更改,如果是次要版本号增加,则不需要更改依赖代码。将代码标记为已弃用是一个非常实用的选择,因为 IDE 和构建系统应该发出警告并允许编码人员切换到较新的版本。如果同一个团队正在更改公共代码和主项目,那么您将需要在同一个工作区中签出实际的 Eclipse 项目,以便重构工具可以完成其工作。
For Java based systems I would recommend that you use Ant+Ivy or Maven and create an internal repository with the code in those common projects.
Option B: Classpath Project If setting up a repository is too much, what you can do is a create an eclipse project called classpath with the following three directories in it
classpath\
docs\
sources\
jars\
The team working on the common project can have a build script which complier the common code and places it into the classpath project, all that the rest of the dev team need to do is checkout the classpath project and reference the files in it during development.
Personally I am a fan of option B unless there is a full time person dedicated to doing builds in which case I go for option A.
The way to manage changes in method signatures is to follow a common version convention so when you do a major version number increase you can say dependent code will have to be changed, and if it is a minor version number increase then dependent code does not need to change. marking code as deprecated is a very practical option because IDE and build systems should issue warnings and allow the coders to switch to newer versions. If the same team is changing the common code and the main project then you will need to have the actual eclipse projects all checked out in the same workspace so that re factoring tools can do their job.
Unless the code in common will be used across across many projects I would keep it in all in one project, you can use multiple source folders to make navigating to various parts of the code easy. If you are having trouble with developers checking in stuff that is breaking things, then I would recommend you have more frequent checkins or have developers work on branches where they merge from the trunk to their work branch frequently to eliminate sync problems, when done they can merge from the branch back to the trunk, the latest version of subversion have decent support for this, and DVCS source control systems like mercurial, and git hub are excellent at this.
发布评论
评论(3)
一定要建立一个存储库。如果您讨厌 Maven,请查看 Gradle,它使用 Ivy。 Maven 因复杂而闻名,但它确实拥有更好的工具支持。 IDE 支持 Maven 开箱即用或通过插件,它们为您提供图表,显示项目中的 jar 所依赖的内容,以便您可以轻松查看冲突。
Ivy 或 Maven 都会整理您的依赖项,以便您的项目使用正确的版本。您的每个项目都应该列出(在 Maven 的 pom.xml 中)它使用的公共库的版本。
Definitely set up a repository. If you are a Maven-hater check out Gradle, it uses Ivy. Maven has a reputation for being complex but it does have better tool support. IDEs support Maven either out-of-the-box or with plugins, they give you graphs showing what the jars in your project depend on, so you can see conflicts easily.
Either Ivy or Maven will sort out your dependencies so your projects are using the right versions. Each of your projects should list (in the pom.xml for Maven) what version of which of your common libraries that it uses.
大多数版本控制系统的一个共同特征是使用外部分支。通用软件从共享存储库中获取,并在更新时集成到每个项目中。
一个关键的困难在于对通用软件的公共 API 的文档更改,我看到了两种解决方案:已弃用签名的良好沟通和持续集成,其中找出已弃用的方法可能会很痛苦。
A common feature of most version control systems is the use of external branches. Common software is fetched from a shared repository and integrated in each project on update.
A key difficulty lies in documentation changes to the public API of common software and I see two solutions : good communication of deprecated signatures adn continuous integration where finding out deprecated methods can prove painfull.
您可以有几种选择。
选项 A:使用存储库
对于基于 Java 的系统,我建议您使用 Ant+Ivy 或 Maven,并使用这些常见项目中的代码创建一个内部存储库。
选项 B:类路径项目
如果设置存储库太多,您可以做的是创建一个名为 classpath 的 eclipse 项目,其中包含以下三个目录
处理公共项目的团队可以有一个构建脚本,该脚本编译公共代码并将其放入类路径项目,开发团队的其他成员需要做的就是签出类路径项目并在开发过程中引用其中的文件。
就我个人而言,我是选项 B 的粉丝,除非有专职人员专门负责构建,在这种情况下我会选择选项 A。
管理方法签名更改的方法是遵循通用版本约定,因此当您执行主要版本时如果版本号增加,则可以说依赖代码必须更改,如果是次要版本号增加,则不需要更改依赖代码。将代码标记为已弃用是一个非常实用的选择,因为 IDE 和构建系统应该发出警告并允许编码人员切换到较新的版本。如果同一个团队正在更改公共代码和主项目,那么您将需要在同一个工作区中签出实际的 Eclipse 项目,以便重构工具可以完成其工作。
除非公共代码将在多个项目中使用,否则我会将其全部保留在一个项目中,您可以使用多个源文件夹来轻松导航到代码的各个部分。如果您在开发人员签入破坏事物的内容时遇到麻烦,那么我建议您更频繁地签入,或者让开发人员在分支上工作,他们经常从主干合并到工作分支,以消除同步问题,完成后他们可以从分支合并回主干,最新版本的 subversion 对此有很好的支持,并且像 Mercurial 和 git hub 这样的 DVCS 源代码控制系统在这方面非常出色。
There are a few options you can have.
Option A: use a repository
For Java based systems I would recommend that you use Ant+Ivy or Maven and create an internal repository with the code in those common projects.
Option B: Classpath Project
If setting up a repository is too much, what you can do is a create an eclipse project called classpath with the following three directories in it
The team working on the common project can have a build script which complier the common code and places it into the classpath project, all that the rest of the dev team need to do is checkout the classpath project and reference the files in it during development.
Personally I am a fan of option B unless there is a full time person dedicated to doing builds in which case I go for option A.
The way to manage changes in method signatures is to follow a common version convention so when you do a major version number increase you can say dependent code will have to be changed, and if it is a minor version number increase then dependent code does not need to change. marking code as deprecated is a very practical option because IDE and build systems should issue warnings and allow the coders to switch to newer versions. If the same team is changing the common code and the main project then you will need to have the actual eclipse projects all checked out in the same workspace so that re factoring tools can do their job.
Unless the code in common will be used across across many projects I would keep it in all in one project, you can use multiple source folders to make navigating to various parts of the code easy. If you are having trouble with developers checking in stuff that is breaking things, then I would recommend you have more frequent checkins or have developers work on branches where they merge from the trunk to their work branch frequently to eliminate sync problems, when done they can merge from the branch back to the trunk, the latest version of subversion have decent support for this, and DVCS source control systems like mercurial, and git hub are excellent at this.