2013-08-07 51 views

回答

0

我會去webapp-runner運行網絡應用程序。它將來自/ target的Maven生成的戰爭部署到一個內置的tomcat容器中。這是如何在Heroku上部署Java應用程序。
POM插件配置:

 <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-dependency-plugin</artifactId> 
      <version>2.4</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>copy</goal> 
        </goals> 
        <configuration> 
         <artifactItems> 
          <artifactItem> 
           <groupId>com.github.jsimone</groupId> 
           <artifactId>webapp-runner</artifactId> 
           <version>7.0.34.1</version> 
           <destFileName>webapp-runner.jar</destFileName> 
          </artifactItem> 
         </artifactItems> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

相關性:

<dependency> 
     <groupId>com.github.jsimone</groupId> 
     <artifactId>webapp-runner</artifactId> 
     <version>7.0.34.1</version> 
     <scope>provided</scope> 
    </dependency> 

運行你有沒有找到任何解決方案mvn clean package

java -jar target\dependency\webapp-runner.jar target\myapp.war