我在一个团队中的其他人的Git存储库上共享了一个Eclipse项目。
我们经常需要在这个项目中添加一些链接资源,有效地修改.project
内容,后来提交并推送到repo。
现在,当另一个用户提取修改并打开其自己的Ecplise实例时,如果他们在配置更改之前已经导入了项目,则Eclipse不会看到更改并仍然使用旧元数据,在编译项目期间显示错误。我发现修复这种情况的唯一方法是删除.metadata
文件夹并重新导入项目。有没有更简单的方法?
编辑:
Eclipse版本为4.6.0.v20160606-1342,Build id:I20160606-1100。我不是在Eclipse上本地工作,而是在派生的IDE(来自Texas Instrument的CCS Studio)上工作,并且更新版本是不可能的。
关于我在评论中提到的NullPointerException
,这里是从日志中获取的堆栈跟踪。
!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2019-04-04 18:16:36.261
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
at com.ti.ccstudio.project.core.internal.temp.XMoveDeleteHook.deleteFile(XMoveDeleteHook.java:83)
at org.eclipse.team.internal.core.MoveDeleteManager.deleteFile(MoveDeleteManager.java:50)
at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1827)
at org.eclipse.core.internal.resources.Resource.delete(Resource.java:782)
at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:163)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:280)
at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:280)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:257)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:305)
at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:96)
at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:221)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
不应该在git中跟踪.project(或任何其他IDE元数据),因为你将一次又一次地面对这样的问题......再次。