Java 在 Eclipse 中,如何从复制到输出文件夹中排除某些文件(可能基于 .svn 扩展名或文件名)?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/225375/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 11:41:53  来源:igfitidea点击:

In Eclipse, how can I exclude some files (maybe based on the .svn extension or filename) from being copied to the output folder?

javaeclipsesvnbuild-process

提问by Alfred B. Thordarson

I'm developing a Java application using Eclipse. My project has two source directories that are both built and then some files are copied into the output folder. From the output directory I then run my application and all works well.

我正在使用 Eclipse 开发 Java 应用程序。我的项目有两个源目录,它们都已构建,然后将一些文件复制到输出文件夹中。然后从输出目录运行我的应用程序,一切正常。

However, I keep having these warnings:

但是,我不断收到这些警告:

Snapshot from Problems tab in Eclipse http://www.freeimagehosting.net/uploads/128c1af93f.png

Eclipse 中问题选项卡的快照 http://www.freeimagehosting.net/uploads/128c1af93f.png

Anyone know how to get rid of these warnings? Maybe by excluding some files, maybe based on the .svn extension or filename, from the build process? If so, how would I go about excluding those?

有谁知道如何摆脱这些警告?也许通过从构建过程中排除一些文件,可能基于 .svn 扩展名或文件名?如果是这样,我将如何排除这些?

采纳答案by fhe

Have you tried to add

您是否尝试添加

**/.svn/

**/.svn/

to the Exclusion patternsat the Sourcepreferences of the project's build path settings?

到项目构建路径设置的首选项中的排除模式

回答by VonC

That sounds like your building process is using versionned directory within your subversion workspace.

这听起来像是您的构建过程正在使用您的 subversion 工作区中的版本化目录。

Should you not have your 'output' folder and/or your 'tst' folder be made 'private' ? (that is without any .svn, and ignored by subversion)

您不应该将“输出”文件夹和/或“tst”文件夹设为“私有”吗?(即没有任何 .svn,并被 subversion 忽略)

回答by fhe

Sure, that easy: at Project Properties -- Java Build Path you can add exclusion filters on every source folder. There, you can add an exclusion pattern as *.svn

当然,就这么简单:在 Project Properties -- Java Build Path 中,您可以在每个源文件夹上添加排除过滤器。在那里,您可以将排除模式添加为 *.svn

回答by fhe

You could also try installing the Subversion plugin (Subclipse) for Eclipse.

您还可以尝试为 Eclipse安装 Subversion 插件 ( Subclipse)。

回答by thouliha

Right click on the source file > Build Path > Exclude.

右键单击源文件 > 构建路径 > 排除。