1

嗨,我有一个奇怪的问题,我自己无法解决。我正在尝试在最新的 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 项目时,错误日志中会出现此错误:

下载原型 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 我不知道为什么它不起作用。我不使用代理等。我的笔记本电脑上有类似的配置,而且效果很好。

4

1 回答 1

0

尽管Maven / 镜像设置指南指出:

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

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

于 2015-09-05T21:21:28.897 回答