Eclipse 中的派生文件是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4849173/
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-09-10 19:54:41  来源:igfitidea点击:

What are derived files in Eclipse?

eclipse

提问by chris

I have problem with derived files. Some of my files in my project are 'derived'. When I want to edit these files, I get the following message:

我有派生文件的问题。我的项目中的一些文件是“派生的”。当我想编辑这些文件时,我收到以下消息:

"This file is derived"

"Do you really want to edit?"

“这个文件是派生的”

“你真的要编辑吗?”

When I right click on this file and choose properties, I see that "Archived" is marked.

当我右键单击此文件并选择属性时,我看到标记为“已存档”。

I think this is a problem with Maven, but I don't know how to fix this or know why part of my files are 'derived'.

我认为这是 Maven 的一个问题,但我不知道如何解决这个问题,也不知道为什么我的部分文件是“派生的”。

回答by Bozho

There isn't necessarily a problem. Derived files are those that are being generated on the basis of other files. And when you edit them, the next time they are generated, your edit is lost.

不一定有问题。派生文件是在其他文件的基础上生成的文件。当您编辑它们时,下次生成它们时,您的编辑就会丢失。

Try to find which are the source files.

尝试查找哪些是源文件。

回答by Kennifer

I just had this problem, I accidentally dragged and dropped a package into the gen folder. This set a flag on the package as derived. When I copied back it still existed, and affected all the sub files.

我刚刚遇到了这个问题,我不小心将一个包拖放到了 gen 文件夹中。这在派生的包上设置了一个标志。当我复制回来时,它仍然存在,并影响了所有子文件。

I just right click on package, properties and unticked Derived, and problem solved.

我只需右键单击包,属性和未勾选的派生,问题就解决了。

回答by Pawel Miechowiecki

You probably tried to edit file in "target" directory.

您可能试图编辑“目标”目录中的文件。

回答by Seppo Enarvi

i had this problem after creating a LaTeX document with TeXlipse. TeXlipse placed the output (PDF) file in the same folder, and marked the entire folder with Derivedattribute. Derived files are those that have been automatically generated and should not be edited or the changes will be lost next time the files are regenerated. Clearly not all the files in the folder were derived. By right clicking on the folder and selecting Properties, I could see that the Derivedattribute was set, but unchecking it did not help (next time it was checked again).

使用 TeXlipse 创建 LaTeX 文档后,我遇到了这个问题。TeXlipse 将输出 (PDF) 文件放在同一文件夹中,并用派生属性标记整个文件夹。派生文件是那些已自动生成的文件,不应编辑,否则下次重新生成文件时更改将丢失。显然,并非文件夹中的所有文件都是派生的。通过右键单击文件夹并选择Properties,我可以看到Derived属性已设置,但取消选中它并没有帮助(下次再次选中时)。

If the problem actually is with Maven, then this won't work, but in case somebody is having this problem after creating a TeXlipse document, here's the solution:

如果问题实际上出在 Maven 上,那么这将不起作用,但万一有人在创建 TeXlipse 文档后遇到此问题,以下是解决方案:

  1. Right click on the project, select Properties, then select Latex Project Properties.
  2. Either uncheck Set LaTeX output files as derived, or modify the Output Filepath so that the file will be written into the project root or into a different folder.
  3. Right click on the folder that has the Derivedattribute, select Properties, uncheck Derived.
  1. 右键单击项目,选择Properties,然后选择Latex Project Properties
  2. 取消选中Set LaTeX 输出文件为衍生,或修改输出文件路径,以便将文件写入项目根目录或不同的文件夹。
  3. 右键单击具有Derived属性的文件夹,选择Properties,取消选中Derived

回答by Rafa Romero

Derived files are those are in targetdirectory and has been generated for packaging. Take a look and try to edit the good ones

派生文件是那些在target目录中并已生成用于打包的文件。看看并尝试编辑好的

回答by Yury

I faced with the same problem during editing Latex documents in TexLipse plugin. Accidentally, I was not able to modify my documents although before this 5 minutes ago I had had this possibility. To overcome the problem I simply deleted the project from the workspace and imported it once again. The checkbox of derived files was not checked.

我在 TexLipse 插件中编辑 Latex 文档时遇到了同样的问题。偶然地,我无法修改我的文件,尽管在 5 分钟前我有这种可能性。为了解决这个问题,我简单地从工作区中删除了该项目并再次导入它。未选中派生文件的复选框。