MyEclipse 不断损坏我的 Tortoise SVN 存储库?
我在使用 MyEclipse Build id: 8.6-20100723 和 SVN 时遇到一些奇怪的行为。我有一个 Java Struts 应用程序,其源文件夹和输出文件夹定义为:
pref_center/war/src/main/webapp/WEB-INF/classes --输出文件夹
pref_center/jar/src/main/java ---Java 文件
当我在 Eclipse 中打开项目时,进行任何更改并保存项目,Eclipse自动将 .svn 文件夹从我的 java 目录复制到我的类文件夹。它还会将已更改的所有 .java 文件复制到classes 文件夹中。结果是 SVN 现在将 src/main/java 目录和 web-INF/classes 目录识别为同一棵树。这会导致无数的冲突并最终导致 SVN 存储库的破坏。我当前的解决方法是手动删除类路径下的所有 .svn 文件夹(我在 SVN 中忽略了这些文件夹),以避免每次在签入之前损坏存储库。
如何确保 MyEclipse 不会将我的 .java 或 .svn 文件复制到类文件夹中?这是一个错误还是可以关闭的东西
注意:不确定这是否重要,但我不使用 MyEclipse 来构建我的项目。我使用 Maven 来构建和打包我的应用程序。
I'm having some strange behavior with MyEclipse Build id: 8.6-20100723 and SVN. I have a Java Struts application with the source and output folders defined as:
pref_center/war/src/main/webapp/WEB-INF/classes --output folder
pref_center/jar/src/main/java ---Java files
When I open the project in Eclipse, make any changes and save the project, Eclipse automatically copies the .svn folders from my java directory to my classes folder. It also copies any .java files that have been changed into the classes folder. The result is that SVN now recognizes the src/main/java directory and the web-INF/classes directory as the same tree. This leads to countless conflicts and eventually the destruction of the SVN repository. My current workaround is to manually delete all the .svn folders from under the classes path (which I have ignored in SVN) to avoid corrupting the repository every time before I do a checkin.
How can I ensure that MyEclipse doesn't copy my .java or .svn files into the classes folder? Is this a bug or something that can be turned off
NOTE:Not sure if it matters but I do not use MyEclipse to build my project. I use maven to build and package my app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在某种程度上,听起来 MyEclipse 正在构建您的项目。它似乎正在将其认为的资源复制到输出目录。
输出目录不应保存在 SVN 中,因此您应该将其添加为忽略资源(右键单击输出文件夹,转到团队子菜单并选择“添加到 svn:ignore”)。为什么 MyEclipse 在团队共享项目中复制 .SVN 文件夹尚不清楚。如果您没有从 MyEclipse 与 SVN 服务器同步,则需要添加 .SVN 作为忽略资源。在这种情况下,您可能需要考虑安装 SVN 插件,例如 subclipse 或 subversive。
最后一件事。由于它将 java 源文件复制到输出文件夹,因此您实际上可能没有为项目设置源文件夹。即使您不是使用 MyEclipse 进行构建(或无意构建),也要确保在构建路径属性中设置了源文件夹。您可能还想检查 MyEclipse 是否确实没有自动构建(检查主项目 -> 自动构建菜单项)。
托尼
It sounds like MyEclipse IS building your project, to some degree. It seems to be copying what it thinks are resources to the output directory.
The output directory should not be saved in SVN so you should add it as an ignored resource (right click on the output folder, go to the Team sub-menu and select "Add to svn:ignore"). Why MyEclipse is copying .SVN folders in a team shared project is not clear. If you are not synching with the SVN server from MyEclipse, you would need to add .SVN as an ignored resource. In this case, you might want to consider installing an SVN plug-in, like subclipse or subversive.
One last thing. As it is copying java source files to the output folder, you may not actually have a source folder set up for your project. Even though you're not building (or don't intentionally build) with MyEclipse, ensure you have a source folder set in the build path properties. You might also want to check that MyEclipse really isn't building automatically (check the main Project->Build Automatically menu item).
Tony