开发者

how to filter files from the root "classes" and "test-classes" folders in Eclipse?

开发者 https://www.devze.com 2023-02-02 19:39 出处:网络
I am using ClearCase in my application which generates a whole load of \".copyarea.db\" files (one in every folder).

I am using ClearCase in my application which generates a whole load of ".copyarea.db" files (one in every folder).

These cause conflicts when publishing to Tomcat as Eclipse will bundle the "classes" and "test-classes" folders into one JAR (not sure why it does this - as there is no need to have test classes available on the application server).

Any folders with the same names will have a separate .copyar开发者_StackOverflowea.db in the classes and test-classes branches.

I managed to get around this problem in general by adding ".copyarea.db" to the Filtered resources on the Java->Compiler->Building->Output Folder preference page. This stops the file appearing in source output (package/class folders), the vast majority of cases.

However there remains the problem of the root folder, i.e. "target/classes/.copyarea.db" and "target/test-classes/.copyarea.db".

These files are not filtered as they are not part of the compile task.

Just deleting the files manually doesn't help either, as Eclipse expects to find them and doesn't.

How can I exclude these ".copyarea.db" files from the root "classes" and "test-classes" folders?


This file .copyarea.db is created in each directory of a web view (through CCRC, the remote client of ClearCase).

The simplest solution would be to not put under source control the directories classes and test-classes.
Then, as 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.

Since you don't usually version the binaries produced under classes and test-classes, removing those folder, and adding them again manually (keeping them private to your view) is an acceptable solution.

If those folders are not under version control, then those copyarea.db come from versioned folders which contain them, and have been copied to the destination folder.
In that case, you can simply remove the copyarea.db files.
But since you said that Eclipse "expects to find them and doesn't", I assume those "classes" and "test-classes" folders are not private folder.


concerning

These cause conflicts when publishing to Tomcat as Eclipse will bundle the "classes" and "test-classes" folders into one JAR (not sure why it does this - as there is no need to have test classes available on the application server)

you can configure this in project properties, build path, order and export, or use maven and m2eclipse!

0

精彩评论

暂无评论...
验证码 换一张
取 消