Maven M2Eclipse插件无法正常工作

时间:2015-09-04 16:31:41

标签: eclipse maven gwt gwt-maven-plugin

嗨,我有一个我自己无法解决的奇怪问题。我想在最新的Spring Tool Suite中使用Maven。我的笔记本电脑没有任何问题,但它在我的电脑上无法正常工作(Windows 7)。两者都有相同版本的STS,Maven和其他插件,如GWT等。

问题是在PC上maven有连接问题(无法更新中心| https://repo.maven.apache.org/maven2的索引) - 这是我之前看到的按摩,不幸的是我无法重现它现在它不断尝试更新但没有任何反应即使经过2个小时的等待(从eclipse开始几秒钟内笔记本电脑更新)两台计算机使用相同的路由器,相同的网络,相同的连接类型wifi。我禁用了所有防火墙等。

第二个问题是我想使用GWT-maven-plugin来启动项目。 Eclipse在添加原型时没有问题,但是当我尝试使用此原型设置maven项目时,错误日志中会出现此错误:

下载archetype org.codehaus.mojo时出错:gwt-maven-plugin:2.7.0

堆栈:

java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:420)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:1002)
    at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage.loadArchetypeDescriptor(MavenProjectWizardArchetypeParametersPage.java:400)
    at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage.setVisible(MavenProjectWizardArchetypeParametersPage.java:561)
    at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1229)
    at org.eclipse.jface.wizard.WizardDialog.access$4(WizardDialog.java:1208)
    at org.eclipse.jface.wizard.WizardDialog$8.run(WizardDialog.java:1197)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1194)
    at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage$13.open(MavenProjectWizardArchetypePage.java:465)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:854)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:50)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:851)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1168)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1275)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:278)
    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:272)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:313)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
    at org.eclipse.jface.window.Window.open(Window.java:803)
    at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:136)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
    at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
Caused by: java.lang.NullPointerException
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.closeZipFile(DefaultArchetypeArtifactManager.java:584)
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isFileSetArchetype(DefaultArchetypeArtifactManager.java:196)
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isFileSetArchetype(DefaultArchetypeArtifactManager.java:209)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager$1.call(ArchetypeManager.java:186)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager$1.call(ArchetypeManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1355)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager.getRequiredProperties(ArchetypeManager.java:183)
    at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage$RequiredPropertiesLoader.run(MavenProjectWizardArchetypeParametersPage.java:457)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Root exception:
java.lang.NullPointerException
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.closeZipFile(DefaultArchetypeArtifactManager.java:584)
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isFileSetArchetype(DefaultArchetypeArtifactManager.java:196)
    at org.apache.maven.archetype.common.DefaultArchetypeArtifactManager.isFileSetArchetype(DefaultArchetypeArtifactManager.java:209)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager$1.call(ArchetypeManager.java:186)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager$1.call(ArchetypeManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:176)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1355)
    at org.eclipse.m2e.core.internal.archetype.ArchetypeManager.getRequiredProperties(ArchetypeManager.java:183)
    at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypeParametersPage$RequiredPropertiesLoader.run(MavenProjectWizardArchetypeParametersPage.java:457)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

我已经尝试过清理maven cashe,project,temp,从一开始就设置STS我不知道为什么它不起作用。我没有使用代理等。我的笔记本电脑上有类似的配置,它运行良好。

1 个答案:

答案 0 :(得分:0)

虽然Maven / Guide to Mirror Settings声明:

  

官方Maven 2存储库位于美国托管的http://repo.maven.apache.org/maven2,或英国托管的http://uk.maven.org/maven2

它实际上是https://repo1.maven.org/maven2/并重定向到它。因此,请使用实际的URL来避免重定向。