如何从我的 netbeans 项目设置 subvresion 存储库

发布于 2024-10-18 11:32:31 字数 412 浏览 1 评论 0原文

我最近收到了一些由我以外的人编写的代码,经过大量工作,包括寻找外部依赖项,并编辑 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

許願樹丅啲祈禱 2024-10-25 11:32:31

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.

迷离° 2024-10-25 11:32:31

我通常使用 Maven,因为你可以拥有一个 jar 和依赖项的存储库,这让生活变得更轻松,但由于你已经重构代码以使用 ANT,也许这不是你想要的,要使用 subversion 与 netbeans 那么你可能需要添加另一个文件夹用于像 libs 之类的 jar 文件,然后是另一个用于像音频等二进制文件的文件夹。还要检查 netbeans 的 svn 插件,它会将忽略添加到目录中并仅更新 java 文件。

要添加要忽略的文件,您可以使用

svn propset svn:ignore -F . 

或者您可以在您的 subversion 主目录中查找配置文件并添加类似的内容

global-ignores=*.classs 

希望这会有所帮助

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

svn propset svn:ignore -F . 

or you can look for the config file in your subversion home and add something like this

global-ignores=*.classs 

Hope this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文