2016-10-16 1 views
0

Я создал простой веб-приложение из jersey archetype в Eclipse, и затем учебник дал here, но команда mvn -e heroku:deploy-war бросает следующие ошибкиВеб-приложение Java дает построить сбой при развертывании на Heroku

$ mvn -e heroku:deploy-war 
[INFO] Error stacktraces are turned on. 
[INFO] Scanning for projects... 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building wallpost 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] >>> heroku-maven-plugin:1.1.1:deploy-war (default-cli) > package @ wallpost >>> 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ wallpost --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 0 resource 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ wallpost --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ wallpost --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory D:\Workspace For Java\wallpost\src\test\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ wallpost --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ wallpost --- 
[INFO] No tests to run. 
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ wallpost --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [wallpost] in [D:\Workspace For Java\wallpost\target\wallpost] 
[INFO] Processing war project 
[INFO] Copying webapp resources [D:\Workspace For Java\wallpost\src\main\webapp] 
[INFO] Webapp assembled in [187 msecs] 
[INFO] Building war: D:\Workspace For Java\wallpost\target\wallpost.war 
[INFO] WEB-INF\web.xml already added, skipping 
[INFO] 
[INFO] --- maven-dependency-plugin:2.3:copy-dependencies (copy-dependencies) @ wallpost --- 
[INFO] hk2-api-2.5.0-b05.jar already exists in destination. 
[INFO] jersey-guava-2.23.2.jar already exists in destination. 
[INFO] hk2-utils-2.5.0-b05.jar already exists in destination. 
[INFO] javassist-3.20.0-GA.jar already exists in destination. 
[INFO] osgi-resource-locator-1.0.1.jar already exists in destination. 
[INFO] jersey-server-2.23.2.jar already exists in destination. 
[INFO] jersey-client-2.23.2.jar already exists in destination. 
[INFO] javax.ws.rs-api-2.0.1.jar already exists in destination. 
[INFO] hk2-locator-2.5.0-b05.jar already exists in destination. 
[INFO] jersey-container-servlet-core-2.23.2.jar already exists in destination. 
[INFO] jersey-common-2.23.2.jar already exists in destination. 
[INFO] validation-api-1.1.0.Final.jar already exists in destination. 
[INFO] aopalliance-repackaged-2.5.0-b05.jar already exists in destination. 
[INFO] jersey-media-jaxb-2.23.2.jar already exists in destination. 
[INFO] javax.inject-2.5.0-b05.jar already exists in destination. 
[INFO] javax.annotation-api-1.2.jar already exists in destination. 
[INFO] 
[INFO] --- maven-dependency-plugin:2.3:copy (default) @ wallpost --- 
[INFO] Configured Artifact: com.github.jsimone:webapp-runner:8.0.30.2:jar 
[INFO] com.github.jsimone:webapp-runner:8.0.30.2:jar already exists in D:\Workspace For Java\wallpost\target\dependency 
[INFO] 
[INFO] <<< heroku-maven-plugin:1.1.1:deploy-war (default-cli) < package @ wallpost <<< 
[INFO] 
[INFO] --- heroku-maven-plugin:1.1.1:deploy-war (default-cli) @ wallpost --- 
[INFO] Configured Artifact: com.github.jsimone:webapp-runner:8.0.30.2:jar 
[INFO] com.github.jsimone:webapp-runner:8.0.30.2:jar already exists in D:\Workspace For Java\wallpost\target\dependency 
[INFO] -----> Packaging application... 
[INFO]  - app: immense-beach-86309t 
[INFO]  - including: target/dependency/webapp-runner.jar 
[INFO]  - including: target/wallpost.war 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 14.865 s 
[INFO] Finished at: 2016-10-17T02:43:01+05:30 
[INFO] Final Memory: 26M/225M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.heroku.sdk:heroku-maven-plugin:1.1.1:deploy-war (default-cli) on project wallpost: Failed to deploy application: Not Found -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.heroku.sdk:heroku-maven-plugin:1.1.1:deploy-war (default-cli) on project wallpost: 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:128) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
     at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
     at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
     at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
     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:498) 
     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.DeployWarMojo.execute(DeployWarMojo.java:26) 
     at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
     at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
     ... 20 more 
Caused by: org.apache.http.client.HttpResponseException: Not Found 
     at com.heroku.sdk.deploy.utils.RestClient.handleResponse(RestClient.java:172) 
     at com.heroku.sdk.deploy.utils.RestClient.get(RestClient.java:66) 
     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:106) 
     at com.heroku.sdk.deploy.Deployer.deploy(Deployer.java:68) 
     at com.heroku.sdk.deploy.App.deploy(App.java:57) 
     at com.heroku.sdk.deploy.App.deploy(App.java:61) 
     at com.heroku.sdk.deploy.WarApp.deploy(WarApp.java:30) 
     at com.heroku.sdk.maven.DeployWarMojo.execute(DeployWarMojo.java:22) 
     ... 22 more 
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 

Я также попробовали упомянутые предложения here, here, here и here, но они были бесполезны. Я убедился, что имя приложения на Heroku соответствует <appName></appName> в pom.xml, но это тоже не решило проблему.

Ниже мой 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 http://maven.apache.org/maven-v4_0_0.xsd"> 

    <modelVersion>4.0.0</modelVersion> 

    <groupId>com.auro.assignment</groupId> 
    <artifactId>wallpost</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>wallpost</name> 

    <build> 
     <finalName>wallpost</finalName> 
     <plugins> 

     <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <version>2.3</version> 
       <executions> 
        <execution> 
         <id>copy-dependencies</id> 
         <phase>package</phase> 
         <goals><goal>copy-dependencies</goal></goals> 
        </execution> 
        <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> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>2.5.1</version> 
       <inherited>true</inherited> 
       <configuration> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
      <plugin> 
       <configuration> 
        <jdkVersion>1.8</jdkVersion> 
        <appName>immense-beach-86309t</appName> 
       </configuration> 
       <groupId>com.heroku.sdk</groupId> 
       <artifactId>heroku-maven-plugin</artifactId> 
       <version>1.1.1</version> 
      </plugin> 
     </plugins> 
    </build> 

    <dependencyManagement> 
     <dependencies> 
      <dependency> 
       <groupId>org.glassfish.jersey</groupId> 
       <artifactId>jersey-bom</artifactId> 
       <version>${jersey.version}</version> 
       <type>pom</type> 
       <scope>import</scope> 
      </dependency> 
     </dependencies> 
    </dependencyManagement> 

    <dependencies> 
     <dependency> 
      <groupId>org.glassfish.jersey.containers</groupId> 
      <artifactId>jersey-container-servlet-core</artifactId> 
      <!-- use the following artifactId if you don't need servlet 2.x compatibility --> 
      <!-- artifactId>jersey-container-servlet</artifactId --> 
     </dependency> 
     <!-- uncomment this to get JSON support 
     <dependency> 
      <groupId>org.glassfish.jersey.media</groupId> 
      <artifactId>jersey-media-moxy</artifactId> 
     </dependency> 
     --> 
    </dependencies> 
    <properties> 
     <jersey.version>2.23.2</jersey.version> 
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 
</project> 

Ниже PROCFILE

web: java $JAVA_OPTS -jar target/dependency/webapp-runner.jar --port $PORT target/*.war 

ответ

0

Я подозреваю, что ваше имя приложение должно быть "огромно-пляж-86309", но у вас есть «immense-beach-86309t» (обратите внимание на «t») в вашей записи pom.xml за <appName>.

Сообщение об ошибке должно быть лучше, и я открыл an issue on the heroku-maven-plugin project, что является открытым исходным кодом.

Смежные вопросы