0

我正在尝试将 Apache James Server 项目导入 Eclipse。

近一周前我已经实现了导入、构建和运行,但现在我不能。

现在它开始挂在“Importing maven projects %93”上

我尝试了几种情况

1)我有 m2eclipse 插件,并且有一个嵌入式 maven 并使用它。

挂点是 %93

2)我在 Ubuntu 上也有一个命令行 maven,当我通过“Window-Prefrences-Maven-Installations”将此 maven(将嵌入更改为此)设置为 Eclipse 时

挂在 %93

3)签出一个新的树干并尝试导入

结果相同

有很多项目都有一个根 pom,每次我尝试时,挂起都从同一个子项目开始。

这里有一个帖子,所以,用户回答说它是关于代理的。

我控制了我的代理设置,没有指定 IP 地址和端口。

此外,我想问一下,如果是关于代理,我如何导入并能够运行该项目?

我的 Eclipse 工作区日志与这种情况有关:

!ENTRY org.eclipse.core.resources 4 4 2012-11-09 18:31:14.132
!MESSAGE Exception loading preferences from: /james-server-queue-activemq/.settings/org.eclipse.core.resources.prefs.
!STACK 1
org.eclipse.core.runtime.CoreException: File not found: /home/gobito-merve/dev/workspace091112/james-server-queue-activemq/.settings/org.eclipse.core.resources.prefs.
    at org.eclipse.core.internal.filesystem.Policy.error(Policy.java:55)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:371)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
    at org.eclipse.core.internal.resources.File.getContents(File.java:289)
    at org.eclipse.core.internal.resources.ProjectPreferences.load(ProjectPreferences.java:461)
    at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:387)
    at org.eclipse.core.internal.preferences.EclipsePreferences.getChild(EclipsePreferences.java:500)
    at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:629)
    at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:757)
    at org.eclipse.core.internal.resources.CharsetManager.isDerivedEncodingStoredSeparately(CharsetManager.java:367)
    at org.eclipse.core.internal.resources.CharsetManager.getPreferences(CharsetManager.java:294)
    at org.eclipse.core.internal.resources.CharsetManager.getCharsetFor(CharsetManager.java:278)
    at org.eclipse.core.internal.resources.Project.getDefaultCharset(Project.java:420)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ContainerUndoState.<init>(ContainerUndoState.java:133)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ProjectUndoState.<init>(ProjectUndoState.java:48)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ResourceUndoState.fromResource(ResourceUndoState.java:44)
    at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:130)
    at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
    at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
    at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:218)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: java.io.FileNotFoundException: /home/gobito-merve/dev/workspace091112/james-server-queue-activemq/.settings/org.eclipse.core.resources.prefs (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362)
    ... 25 more
!SUBENTRY 1 org.eclipse.core.filesystem 4 271 2012-11-09 18:31:14.133
!MESSAGE File not found: /home/gobito-merve/dev/workspace091112/james-server-queue-activemq/.settings/org.eclipse.core.resources.prefs.
!STACK 0
java.io.FileNotFoundException: /home/gobito-merve/dev/workspace091112/james-server-queue-activemq/.settings/org.eclipse.core.resources.prefs (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.eclipse.core.internal.filesystem.local.LocalFile.openInputStream(LocalFile.java:362)
    at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:797)
    at org.eclipse.core.internal.resources.File.getContents(File.java:289)
    at org.eclipse.core.internal.resources.ProjectPreferences.load(ProjectPreferences.java:461)
    at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:387)
    at org.eclipse.core.internal.preferences.EclipsePreferences.getChild(EclipsePreferences.java:500)
    at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:629)
    at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:757)
    at org.eclipse.core.internal.resources.CharsetManager.isDerivedEncodingStoredSeparately(CharsetManager.java:367)
    at org.eclipse.core.internal.resources.CharsetManager.getPreferences(CharsetManager.java:294)
    at org.eclipse.core.internal.resources.CharsetManager.getCharsetFor(CharsetManager.java:278)
    at org.eclipse.core.internal.resources.Project.getDefaultCharset(Project.java:420)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ContainerUndoState.<init>(ContainerUndoState.java:133)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ProjectUndoState.<init>(ProjectUndoState.java:48)
    at org.eclipse.ltk.internal.core.refactoring.resource.undostates.ResourceUndoState.fromResource(ResourceUndoState.java:44)
    at org.eclipse.ltk.core.refactoring.resource.DeleteResourceChange.perform(DeleteResourceChange.java:130)
    at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
    at org.eclipse.ltk.core.refactoring.CompositeChange.perform(CompositeChange.java:278)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation$1.run(PerformChangeOperation.java:258)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.executeChange(PerformChangeOperation.java:306)
    at org.eclipse.ltk.internal.ui.refactoring.UIPerformChangeOperation.executeChange(UIPerformChangeOperation.java:92)
    at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:218)
    at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

感谢您的建议。

4

2 回答 2

1

有时一个项目对于 Eclipse / m2eclipse 来说太大了,至少在我的经验中是这样。以下是我用来哄骗 Eclipse 处理大型项目的一些技巧。

1)关闭“自动构建”功能 - 似乎这是通常会破坏日食的位。

2) 考虑关闭其他 m2eclipse maven 功能,如下载源和 javadoc;这些只是很慢。

3) 从命令行对您的项目进行 SCM 检查,并从命令行构建它们。我建议此时让 maven 检索源代码和 javadocs;这样你就不会让 Eclipse 做那么大的家务活。

4) 在 Eclipse 中,仅在您需要的模块上“导入现有的 Maven 项目”。考虑到您并不“需要”一个模块来成为一个 Eclipse 项目,只是为了阅读它的源代码。如果您在命令行构建期间下载了源代码,那么您在 eclipse 中拥有的任何项目都将能够在代码浏览和调试中单步执行它的依赖项源代码,因为 eclipse 知道如何在您的本地 Maven 仓库。

如果有人有更多关于充分利用 m2eclipse 的技巧,我很乐意在这里添加它们。

于 2012-11-12T15:23:18.143 回答
0

我已将 eclipse 的文件夹从一个地方移动到另一个地方,并且该文件夹错误地获得了 root 权限。因此,当我调用 eclipse 时,我使用超级用户执行此操作,并且 eclipse 的M2_REPO路径已更改为/root/.m2/repository. 现在我改变了previliges并M2_REPO重新设置/home/myuser/.m2/repository并且问题已经消失了。

于 2012-11-12T11:50:04.020 回答