无法确定应用程序名称,请显式配置 安装Heroky Intelliji。

huangapple go评论67阅读模式
英文:

Could not determine app name, please configure it explicitly Intelliji Heroky deployment

问题

我按照这个教程部署了我的 Java Web 应用程序,从 IntelliJ IDE 到 Heroku,但是出现了一些错误。

错误信息如下:

Failed to execute goal com.heroku.sdk:heroku-maven-plugin:3.0.3:deploy-war (default-cli) on project covid-tracker: Could not determine app name, please configure it explicitly!

这是我的 pom.xml 文件内容:

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.coidtracker</groupId>
  <artifactId>covid-tracker</artifactId>
  <version>1.0</version>
  <packaging>war</packaging>

  <!-- ... 依赖项 ... -->

  <build>
    <plugins>
      <plugin>
        <groupId>com.heroku.sdk</groupId>
        <artifactId>heroku-maven-plugin</artifactId>
        <version>3.0.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.github.jsimone</groupId>
                  <artifactId>webapp-runner</artifactId>
                  <version>8.0.30.2</version>
                  <destFileName>webapp-runner.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

是否有解决方案?

英文:

I flowed this tutorial to deploy my java web app from intellij IDE to heroku, but some error occurs

Failed to execute goal com.heroku.sdk:heroku-maven-plugin:3.0.3:deploy-war (default-cli) on project covid-tracker: Could not determine app name, please configure it explicitly!

This is my pom.xml file

    &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
&lt;groupId&gt;com.coidtracker&lt;/groupId&gt;
&lt;artifactId&gt;covid-tracker&lt;/artifactId&gt;
&lt;version&gt;1.0&lt;/version&gt;
&lt;packaging&gt;war&lt;/packaging&gt;
&lt;properties&gt;
&lt;servlet.api.version&gt;3.1.0&lt;/servlet.api.version&gt;
&lt;springframework.version&gt;4.3.13.RELEASE&lt;/springframework.version&gt;
&lt;springsecurity.version&gt;3.2.8.RELEASE&lt;/springsecurity.version&gt;
&lt;jsp.api.version&gt;2.3.1&lt;/jsp.api.version&gt;
&lt;jstl.version&gt;1.2&lt;/jstl.version&gt;
&lt;hibernate.version&gt;4.3.6.Final&lt;/hibernate.version&gt;
&lt;spring.data&gt;1.11.5.RELEASE&lt;/spring.data&gt;
&lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
&lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
&lt;/properties&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;commons-logging&lt;/groupId&gt;
&lt;artifactId&gt;commons-logging-api&lt;/artifactId&gt;
&lt;version&gt;1.1&lt;/version&gt;
&lt;exclusions&gt;
&lt;exclusion&gt;
&lt;groupId&gt;javax.servlet&lt;/groupId&gt;
&lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
&lt;/exclusion&gt;
&lt;/exclusions&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate.validator&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
&lt;version&gt;6.0.13.Final&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- Spring --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-core&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-web&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-context&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- spring aspects --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework&lt;/groupId&gt;
&lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
&lt;version&gt;${springframework.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- spring security --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
&lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
&lt;version&gt;${springsecurity.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
&lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
&lt;version&gt;${springsecurity.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
&lt;artifactId&gt;spring-security-acl&lt;/artifactId&gt;
&lt;version&gt;${springsecurity.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- spring secuirty taglibs --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
&lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
&lt;version&gt;${springsecurity.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- servlet api --&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.servlet&lt;/groupId&gt;
&lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
&lt;version&gt;${servlet.api.version}&lt;/version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
&lt;!-- jsp api --&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
&lt;artifactId&gt;javax.servlet.jsp-api&lt;/artifactId&gt;
&lt;version&gt;${jsp.api.version}&lt;/version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
&lt;!-- jstl --&gt;
&lt;dependency&gt;
&lt;groupId&gt;javax.servlet&lt;/groupId&gt;
&lt;artifactId&gt;jstl&lt;/artifactId&gt;
&lt;version&gt;${jstl.version}&lt;/version&gt;
&lt;scope&gt;provided&lt;/scope&gt;
&lt;/dependency&gt;
&lt;!-- sitemesh decorator --&gt;
&lt;dependency&gt;
&lt;groupId&gt;opensymphony&lt;/groupId&gt;
&lt;artifactId&gt;sitemesh&lt;/artifactId&gt;
&lt;version&gt;2.4.2&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- SQL --&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.microsoft.sqlserver&lt;/groupId&gt;
&lt;artifactId&gt;mssql-jdbc&lt;/artifactId&gt;
&lt;version&gt;6.1.0.jre8&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- Hibernate --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
&lt;version&gt;${hibernate.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate.javax.persistence&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-jpa-2.1-api&lt;/artifactId&gt;
&lt;version&gt;1.0.0.Final&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.hibernate&lt;/groupId&gt;
&lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
&lt;version&gt;${hibernate.version}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- Spring data --&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
&lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
&lt;version&gt;${spring.data}&lt;/version&gt;
&lt;/dependency&gt;
&lt;!-- json --&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
&lt;artifactId&gt;jackson-core&lt;/artifactId&gt;
&lt;version&gt;2.6.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
&lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;
&lt;version&gt;2.6.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;
&lt;artifactId&gt;jackson-annotations&lt;/artifactId&gt;
&lt;version&gt;2.6.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
&lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
&lt;version&gt;1.9.13&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
&lt;artifactId&gt;jackson-core-asl&lt;/artifactId&gt;
&lt;version&gt;1.9.13&lt;/version&gt;
&lt;/dependency&gt;
&lt;!--end json --&gt;
&lt;dependency&gt;
&lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
&lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
&lt;version&gt;1.9.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;build&gt;
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;com.heroku.sdk&lt;/groupId&gt;
&lt;artifactId&gt;heroku-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;3.0.3&lt;/version&gt;
&lt;/plugin&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
&lt;version&gt;2.3&lt;/version&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;phase&gt;package&lt;/phase&gt;
&lt;goals&gt;
&lt;goal&gt;copy&lt;/goal&gt;
&lt;/goals&gt;
&lt;configuration&gt;
&lt;artifactItems&gt;
&lt;artifactItem&gt;
&lt;groupId&gt;com.github.jsimone&lt;/groupId&gt;
&lt;artifactId&gt;webapp-runner&lt;/artifactId&gt;
&lt;version&gt;8.0.30.2&lt;/version&gt;
&lt;destFileName&gt;webapp-runner.jar&lt;/destFileName&gt;
&lt;/artifactItem&gt;
&lt;/artifactItems&gt;
&lt;/configuration&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/build&gt;
&lt;/project&gt;

Is there any sollution for this
1: https://devcenter.heroku.com/articles/deploying-java-applications-to-heroku-from-eclipse-or-intellij-idea#setting-up-the-heroku-maven-plugin

答案1

得分: 3

我也遇到了同样的问题。要解决它,需要在你的 pom.xml 文件中添加<configuration>,类似这样:

    &lt;plugin&gt;
&lt;groupId&gt;com.heroku.sdk&lt;/groupId&gt;
&lt;artifactId&gt;heroku-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;3.0.3&lt;/version&gt;
&lt;configuration&gt;
&lt;appName&gt;你的应用名称&lt;/appName&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
英文:

I had the same problem. To solve it add <configuration> to your pom.xml file. Something like this:

    &lt;plugin&gt;
&lt;groupId&gt;com.heroku.sdk&lt;/groupId&gt;
&lt;artifactId&gt;heroku-maven-plugin&lt;/artifactId&gt;
&lt;version&gt;3.0.3&lt;/version&gt;
&lt;configuration&gt;
&lt;appName&gt;Your-app-name&lt;/appName&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;

huangapple
  • 本文由 发表于 2020年9月11日 11:50:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63840550.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定