如何让Eclipse / m2eclipse接受一个没有挂起的大项目设置?

时间:2012-11-09 17:26:44

标签: eclipse maven import maven-plugin m2eclipse

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

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

现在它开始挂起“导入maven项目%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)

感谢您的建议。

2 个答案:

答案 0 :(得分:1)

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

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

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

3)从commmandline执行SCM签出项目,并从命令行构建它们。我建议让maven在这个时候检索源和javadocs;这样你就不会让日食做那件大事。

4)在Eclipse中,仅在您需要的模块上“导入现有Maven项目”。考虑到你不需要一个模块成为一个eclipse项目只是为了阅读它的来源。如果您在命令行构建期间下载了源代码,那么您在eclipse中拥有的任何项目都可以在代码浏览和调试中进入它的依赖源代码,因为eclipse知道如何在您的代码中查找源工件当地的maven回购。

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

答案 1 :(得分:0)

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