本文介绍了无法使用Maven部署到Heroku:禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用Heroku Maven插件将一个具有依赖关系的jar部署到Heroku中。我收到以下错误消息:
I'm trying to deploy a jar with dependencies to Heroku, using the Heroku Maven plugin. I'm getting this error message:
[ERROR] Failed to execute goal com.heroku.sdk:heroku-maven-plugin:0.4.4:deploy (default-cli) on project my-app: Failed to deploy application: Forbidden -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.heroku.sdk:heroku-maven-plugin:0.4.4:deploy (default-cli) on project my-app: Failed to deploy application at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214) at org.apache.maven.cli.MavenCli.main(MavenCli.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoFailureException: Failed to deploy application at com.heroku.sdk.maven.DeployMojo.execute(DeployMojo.java:51) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) ... 19 more Caused by: org.apache.http.client.HttpResponseException: Forbidden at com.heroku.sdk.deploy.utils.RestClient.handleResponse(RestClient.java:136) at com.heroku.sdk.deploy.utils.RestClient.get(RestClient.java:30) at com.heroku.sdk.deploy.ConfigVars.getConfigVars(ConfigVars.java:41) at com.heroku.sdk.deploy.ConfigVars.merge(ConfigVars.java:24) at com.heroku.sdk.deploy.Deployer.mergeConfigVars(Deployer.java:103) at com.heroku.sdk.deploy.Deployer.deploy(Deployer.java:67) at com.heroku.sdk.deploy.App.deploy(App.java:57) at com.heroku.sdk.deploy.App.deploy(App.java:61) at com.heroku.sdk.maven.DeployMojo.execute(DeployMojo.java:47) ... 21 more我找不到如何解决。什么是被禁止的? 这是我的POM:
Which I can't find out how to fix. What exactly is forbidden? This is my POM:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>Main</mainClass> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>com.heroku.sdk</groupId> <artifactId>heroku-maven-plugin</artifactId> <version>0.4.4</version> <configuration> <jdkVersion>1.8</jdkVersion> <appName>my-app</appName> <processTypes> <web>web: java -jar ./target/my-app-1.0-jar-with-dependencies.jar</web> </processTypes> </configuration> </plugin> </plugins> </build>我现在头撞墙了半个小时。任何帮助将不胜感激。
Been beating my head against the wall for half an hour now. Any help would be greatly appreciated.
编辑:我正在使用heroku:deploy
I'm using heroku:deploy
推荐答案重复评论,这可以被标记为已回答。问题在于 pom.xml中的appName
Repeating the comments so this can be marked as answered. The problem was the appName in the pom.xml
<appName>my-app</appName>这应该设置为您的Heroku应用程序的名称。
This should be set to the name of your Heroku app.
更多推荐
无法使用Maven部署到Heroku:禁止
发布评论