如何从我的 netbeans 项目设置 subvresion 存储库
我最近收到了一些由我以外的人编写的代码,经过大量工作,包括寻找外部依赖项,并编辑 build.xml 文件以使 ANT 以合理的方式构建内容,我想现在将代码放入 subversion 存储库中。
我所在的团队规模很小,但团队成员经常更换。所以我希望人们能够尽快开始编写这段代码。从存储库进行简单的检出,然后在 Netbeans 中打开项目以使所有内容正确构建和执行将是理想的选择。
当存在不会位于其他团队成员计算机上的外部依赖项时,如何实现此目的?
- 我应该将我的项目使用的库放在 VCS 中吗?
- 如何指示 subversion 不跟踪生成的文件,例如类文件和 jar 文件?
- 图像和声音等不太可能改变的二进制资源是否应该放置在 VCS 中?如果不是,分发它们的最佳方式是什么?
谢谢。
I was recently given some code that was worked on by someone other than myself, and after lots of work involving hunting down external dependencies, and editing the build.xml file to get ANT to build things in a sane way, I'd like to now get the code into a subversion repository.
The team I'm working on is rather small, but the members on the team change often. So I want people to be able to start working on this code as quickly as possible. A simple checkout from the repository, and opening the project in Netbeans to have everything building and executing properly would be ideal.
How do I achieve this when there are external dependencies that are not going to be on other team members machines?
- Should I place the libraries my project uses in the VCS?
- How do I instruct subversion to not track generated files such as class files and jar files?
- Should binary resources that are unlikely to change such as images and sounds be placed in the VCS? If not what would be the best way to distribute them?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
1)是的。构建和部署应用程序所需的任何东西,不是由构建过程生成的,都将进入版本控制(是的,我知道 Maven 粉丝不喜欢这样)。
2)确保生成的所有内容都进入您从版本控制中排除的不同目录。
3) 参见1)。同样的事情。与项目文档、发行说明等相同。
当然,最大的问题是将在 IDE 配置文件中设置的目录名称,并且在开发机器之间有所不同。
不仅是项目目录的位置,而且 IDE 本身、JDK 和其他工具、应用程序服务器在机器之间都可能不同。这是一个持续存在的问题。
1) yes. Anything needed to build and deploy the application and isn't generated by the build process goes into version control (yah, I know the maven fanz don't like that).
2) make sure everything that's generated goes into distinct directories that you exclude from version control.
3) see 1). Same thing. Same with project documentation, release notes, etc. etc.
The biggest problem of course are directory names which will be set in your IDEs configuration files and differ between development machines.
Not just the location of the project directories, but the IDE itself, JDKs and other tools, appservers, can all be different between machines. It's a constant problem.
我通常使用 Maven,因为你可以拥有一个 jar 和依赖项的存储库,这让生活变得更轻松,但由于你已经重构代码以使用 ANT,也许这不是你想要的,要使用 subversion 与 netbeans 那么你可能需要添加另一个文件夹用于像 libs 之类的 jar 文件,然后是另一个用于像音频等二进制文件的文件夹。还要检查 netbeans 的 svn 插件,它会将忽略添加到目录中并仅更新 java 文件。
要添加要忽略的文件,您可以使用
或者您可以在您的 subversion 主目录中查找配置文件并添加类似的内容
希望这会有所帮助
I usually use maven cause you can have a repository for jars and dependencies this makes life easier, but since you have already refactor your code to use ANT maybe this is not what you want, to use subversion with netbeans then you might want to add another folder for jars like libs or something and then another for the binaries like audio etc. Also check for the svn plugin for netbeans it will add the ignore to the dir and just update java files.
To add files to ignore you can use
or you can look for the config file in your subversion home and add something like this
Hope this helps