我在我的应用程序中使用 ClearCase,它会生成一整套“.copyarea.db
”文件(每个文件夹中一个)。
这些在发布到 Tomcat 时会导致冲突,因为 Eclipse 会将“classes
”和“test-classes
”文件夹捆绑到一个 JAR 中(不确定为什么这样做 - 因为有无需在应用程序服务器上提供可用的测试类。
任何具有相同名称的文件夹将在类和测试类分支中有一个单独的 .copyarea.db
。
我设法通过将“.copyarea.db
”添加到 Java->Compiler->Building->Output Folder
上的过滤资源来解决这个问题> 首选项页面。在绝大多数情况下,这会阻止文件出现在源输出(包/类文件夹)中。
但是根文件夹仍然存在问题,即“target/classes/.copyarea.db
”和“target/test-classes/.copyarea.db
” ".
这些文件未被过滤,因为它们不是编译任务的一部分。
仅手动删除文件也无济于事,因为 Eclipse 希望找到它们,但没有找到。
如何从根“classes”和“test-classes”文件夹中排除这些“.copyarea.db
”文件?
最佳答案
此文件 .copyarea.db
is created in each directory of a web view (通过 CCRC,ClearCase 的远程客户端)。
最简单的解决方案是不置于源代码控制之下目录类和测试类。
然后,作为 illustrated by this technote :
Otherwise, the directory should not be controlled.
If the directory is not controlled, then the.copyarea.db
file within it should never be created.
If the directory was accidentally added to source control, this could be prevented in the future by adding classes to the ignore list. This would avoid the directory being passed to ClearCase during the Share.
由于您通常不会对在类和测试类下生成的二进制文件进行版本控制,因此删除这些文件夹并再次手动添加它们(让它们在您的 View 中保持私有(private))是一个可接受的解决方案。
如果这些文件夹不受版本控制,那么那些 copyarea.db
来自包含它们的版本化文件夹,并已被复制到目标文件夹。
在这种情况下,您可以简单地删除 copyarea.db
文件。
但是既然你说 Eclipse“期望找到它们但没有”,我假设那些“classes
”和“test-classes
”文件夹不是私有(private)文件夹。
关于java - 如何从 Eclipse 中的根目录 "classes"和 "test-classes"文件夹中过滤文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4625465/