我有一个用Eclipse制作的Java Web应用程序,我正在使用maven。它在localhost(Apache Tomcat)上运行正常。当我尝试使用this guide部署到Heroku时,我收到以下错误(已启用DEBUG)。它似乎非常模糊,因为谷歌几乎找不到任何东西。
[错误]无法执行目标 com.heroku.sdk:heroku-maven-plugin:0.1.9:deploy-war(default-cli)on 项目参观:无法部署应用程序:有一个例外 调用远程服务:HTTP(403):服务器返回HTTP响应 代码:403用于网址:https://api.heroku.com/apps/tours/config-vars - > [帮助1] org.apache.maven.lifecycle.LifecycleExecutionException: 无法执行目标 com.heroku.sdk:heroku-maven-plugin:0.1.9:deploy-war(default-cli)on 项目参观:无法部署应用程序 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108) 在 org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76) 在 org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 在 org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116) 在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)at at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)at org.apache.maven.cli.MavenCli.execute(mavenCli.java:584)at at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)at at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)at at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)at sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)at java.lang.reflect.Method.invoke(未知来源)at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 在 org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 在 org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 在 org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 引起:org.apache.maven.plugin.MojoFailureException:失败 部署应用程序 com.heroku.sdk.maven.DeployWarMojo.execute(DeployWarMojo.java:58)at at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133) 在 org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19更多引起:com.heroku.sdk.deploy.Curl $ CurlException: 调用远程服务时发生异常:HTTP(403)at com.heroku.sdk.deploy.Curl.handleResponse(Curl.java:94)at com.heroku.sdk.deploy.Curl.get(Curl.java:22)at com.heroku.sdk.deploy.App.getConfigVars(App.java:139)at at com.heroku.sdk.deploy.App.deploy(App.java:77)at com.heroku.sdk.deploy.App.deploy(App.java:93)at com.heroku.sdk.deploy.WarApp.deploy(WarApp.java:38)at com.heroku.sdk.maven.DeployWarMojo.execute(DeployWarMojo.java:54)... 21更多引起:java.io.IOException:服务器返回HTTP响应 代码:403代表网址:https://api.heroku.com/apps/tours/config-vars at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(未知 来源)at sun.net.www.protocol.http.HttpURLConnection.getInputStream(未知 来源)at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(未知 来源)com.heroku.sdk.deploy.Curl.handleResponse(Curl.java:90) ... 27更多[错误] [错误] [错误]有关的更多信息 错误和可能的解决方案,请阅读以下文章: [错误] [帮助1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
这是我的.pom文件,如果这对任何事情都有帮助:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>pl.xpam.sp</groupId>
<artifactId>tours</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>tours Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.7</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>com.heroku.sdk</groupId>
<artifactId>heroku-maven-plugin</artifactId>
<version>0.1.9</version>
<configuration>
<appName>tours</appName>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
答案 0 :(得分:0)
为HEROKU_API_KEY like in this answer设置Eclipse环境变量(但当然使用不同的键名)。 HEROKU_API_KEY的值应该是运行heroku auth时打印的内容:token
有问题的文件已经奇迹般地更新了完整的描述;)