简体   繁体   English

m2eclipse将'target'目录标记为'Derived'

[英]m2eclipse marking 'target' directory as 'Derived'

I have a Maven Java project, imported using m2eclipse . 我有一个使用m2eclipse导入的Maven Java项目。

The target/ directory is not marked as ' Derived ' by m2eclipse . target/目录未被m2eclipse标记为“ Derived ”。

Problems: 问题:

  • It is validated, so any validation error appear twice. 它已经过验证,因此任何验证错误都会出现两次。 My example shows a JSP Problem , when I insert intentionally an error in a jsp. 我的例子显示了JSP Problem ,当我故意在jsp中插入错误时。
  • When I want to open a resource with Ctrl-Shift-R, all files appear twice, and I run the risk of editing the copy instead of the original file. 当我想用Ctrl-Shift-R打开资源时,所有文件都出现两次,我冒着编辑副本而不是原始文件的风险。

Possibly see post eclipse-ignore-folder 可能会看到post eclipse-ignore-folder

Note: When I set manually the directory to derived, the validation problem doesn't disappear, so that would only be part of the solution... 注意:当我手动将目录设置为派生时,验证问题不会消失,因此这只是解决方案的一部分......

Question: 题:
Is there something I need to do, so that m2eclipse sets the target/ directory to 'Derived' ? 有什么我需要做的,所以m2eclipse将target/目录设置为'派生'?

Yeah, that has been around for a while. 是的,那已经有一段时间了。 I wrote a plug-in that allows you to mark directories as "derived" without having to find them all ( http://eclipsefrills.sourceforge.net/ ). 我写了一个插件,允许你将目录标记为“派生”而不必全部找到它们( http://eclipsefrills.sourceforge.net/ )。 It's not great, and you still have to manually run the action to make it work, but it may help. 这不是很好,你仍然需要手动运行动作才能使它工作,但它可能会有所帮助。

Odd, though, I have not noticed the problem lately, myself. 奇怪的是,我最近没有注意到这个问题,我自己。 I wonder if there is some setting in the preferences that takes care of this now. 我想知道在偏好中是否有一些设置可以解决这个问题。

Good luck. 祝好运。

I got rid of this problem by writing a custom plug-in KeepTargetDerivedPlugin . 我通过编写自定义插件KeepTargetDerivedPlugin解决了这个问题。 As its name suggests, it automatically keeps all target folders derived (unlike the other solutions, which require user action). 顾名思义,它会自动保存所有目标文件夹(与其他需要用户操作的解决方案不同)。

Still, eg the YA2O's plug-in can be used to mark derived folders of projects which already reside in the given Eclipse workspace. 但是,例如, YA2O的插件可用于标记已存在于给定Eclipse工作空间中的项目的派生文件夹。

是的: 打开错误报告 :)

I have been so annoyed by this problem that I wrote a plugin to solve it. 我一直对这个问题感到恼火,我写了一个插件来解决它。 You can get the source and jar from here . 你可以从这里获得源码和jar。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM