使用 Eclipse 的 Azure 部署导致从发布设置文件导入订阅时出错

Azure deployment with eclipse result in error importing subscriptions from publish settings file

我在 eclipse 中的 azure 部署运行完美。直到我用 eclipse 重新导入了 PUBLISH-SETTINGS 文件。从那时起我收到以下错误:

Exception:org.eclipse.core.runtime.CoreException: package.xml:158: com.microsoft.tooling.msservices.helpers.azure.AzureCmdException: Error importing subscriptions from publish settings file

pluginId            org.eclipse.ant.launching
pluginVersion       1.1.101.v20160203-1242
code                0
severity            4
message             Ant Build Failed
fingerprint         2101170b882777b0017f6e1a72eceb81

Exception:org.eclipse.core.runtime.CoreException: package.xml:158: com.microsoft.tooling.msservices.helpers.azure.AzureCmdException: Error importing subscriptions from publish settings file
     at org.eclipse.ant.core.AntRunner.handleInvocationTargetException(AntRunner.java:448)
     at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
     at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.runInSameVM(AntLaunchDelegate.java:290)
     at org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate.launch(AntLaunchDelegate.java:249)
     at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
     at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
     at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:731)
     at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.launchBuild(ExternalToolBuilder.java:183)
     at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.doBuildBasedOnScope(ExternalToolBuilder.java:171)
     at org.eclipse.core.externaltools.internal.model.ExternalToolBuilder.build(ExternalToolBuilder.java:90)
     at org.eclipse.core.internal.events.BuildManager.run(BuildManager.java:734)
     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245)
     at org.eclipse.core.internal.events.BuildManager.run(BuildManager.java:300)
     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
     at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:262)
     at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:402)
     at org.eclipse.core.internal.resources.Project.run(Project.java:556)
     at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2241)
     at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:534)
     at org.eclipse.core.internal.resources.Project.build(Project.java:111)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.apache.tools.ant.BuildException: com.microsoft.tooling.msservices.helpers.azure.AzureCmdException: Error importing subscriptions from publish settings file
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
     at sun.reflect.GeneratedMethodAccessor75.invoke(null:-1)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
     at java.lang.reflect.Method.invoke(null:-1)
     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     at org.apache.tools.ant.Task.perform(Task.java:348)
     at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:454)
     at java.lang.Thread.run(null:-1)
Caused by: HIDDEN: Error importing subscriptions from publish settings file
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
     at sun.reflect.GeneratedMethodAccessor75.invoke(null:-1)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
     at java.lang.reflect.Method.invoke(null:-1)
     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     at org.apache.tools.ant.Task.perform(Task.java:348)
     at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:454)
     at java.lang.Thread.run(null:-1)
Caused by: java.lang.RuntimeException: Service or property not registered:  com.microsoft.windowsazure.management.ManagementClient interface com.microsoft.windowsazure.management.ManagementClient
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at HIDDEN.HIDDEN(HIDDEN:-1)
     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
     at sun.reflect.GeneratedMethodAccessor75.invoke(null:-1)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(null:-1)
     at java.lang.reflect.Method.invoke(null:-1)
     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     at org.apache.tools.ant.Task.perform(Task.java:348)
     at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:454)
     at java.lang.Thread.run(null:-1)

我已经尝试过以下方法:

  1. 重试导入 PUBLISH-SETTINGS 文件
  2. 还原我的 azure 项目
  3. 启动干净的 azure 部署项目
  4. 在 eclipse 中重新安装 azure 插件
  5. 删除了 c:\users\\ 中的 .m2 .p2 和 .eclipse 文件夹
  6. 安装新的eclipse版本(mars.2)并用eclipse market安装azure

终于解决了

我在 Eclipse 中发现了一个额外的选项,我看到了登录按钮。当我登录时,问题就消失了。要打开此菜单,请右键单击您的 azure 部署项目 > 属性 > azure > 订阅。