从IntelliJ IDEA部署Java Web应用程序到Heroku [英] Deploying Java Web Applications to Heroku from IntelliJ IDEA

查看:335
本文介绍了从IntelliJ IDEA部署Java Web应用程序到Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我喜欢在web容器tomcat上运行的java web应用程序。 Web应用程序使用Hibernate框架连接到数据库,我需要将它从IntelliJ 14.0.2部署到heruko。所以我添加了maven框架,这是pom.xml:

 < project xmlns =http:// maven。 apache.org/POM/4.0.0xmlns: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.mastertheboss< / groupId>
< artifactId> HibernateExample< / artifactId>
<包装> jar< / packaging>
< version> 1.0.0< / version>
< name> HibernateExample< / name>
< url> http://maven.apache.org< / url>

<依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 4.0.1.Final< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-validator< / artifactId>
< version> 4.2.0.Final< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate.common< / groupId>
< artifactId> hibernate-commons-annotations< / artifactId>
< version> 4.0.1.Final< / version>
< classifier>测试< / classifier>
< /依赖关系>
< dependency>
< groupId> org.hibernate.javax.persistence< / groupId>
< artifactId> hibernate-jpa-2.0-api< / artifactId>
< version> 1.0.1.Final< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-entitymanager< / artifactId>
< version> 4.0.1.Final< / version>
< /依赖关系>
< dependency>
< groupId> javax.validation< / groupId>
< artifactId> validation-api< / artifactId>
< version> 1.0.0.GA< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>
< dependency>
< groupId> org.jboss.logging< / groupId>
< artifactId> jboss-logging< / artifactId>
< version> 3.1.0.CR2< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>

< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.10< / version>
< /依赖关系>


< / dependencies>



当et编辑配置maven并运行它,我得到的消息:
[错误]在当前项目和插件组中找不到用于前缀'heroku'的插件[org.apache.maven.plugins,org.codehaus.mojo]可从存储库[local(C:\ Users \ User.m2 \ repository),central( https://repo.maven.apache.org/maven2)] - > [Help 1]



有什么想法?

解决方案

听起来你正在尝试运行 mvn heroku:deploy-war ?您需要添加heroku-maven插件才能工作。以下是指南:
https:/ /devcenter.heroku.com/articles/deploying-java-applications-with-the-heroku-maven-plugin


I hava java web application that run on the web container tomcat. The web app connect to a DB with hibernate framework, and I need to deploy it to heruko from the IntelliJ 14.0.2. so i added the maven framework and this is the 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.mastertheboss</groupId>
<artifactId>HibernateExample</artifactId>
<packaging>jar</packaging>
<version>1.0.0</version>
<name>HibernateExample</name>
<url>http://maven.apache.org</url>

<dependencies>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.0.1.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.2.0.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate.common</groupId>
        <artifactId>hibernate-commons-annotations</artifactId>
        <version>4.0.1.Final</version>
        <classifier>tests</classifier>
    </dependency>
    <dependency>
        <groupId>org.hibernate.javax.persistence</groupId>
        <artifactId>hibernate-jpa-2.0-api</artifactId>
        <version>1.0.1.Final</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.0.1.Final</version>
    </dependency>
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.0.0.GA</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.6.4</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.logging</groupId>
        <artifactId>jboss-logging</artifactId>
        <version>3.1.0.CR2</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.6.4</version>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.10</version>
    </dependency>


</dependencies>

When et the edit configuration of the maven and run it, I get the message: [ERROR] No plugin found for prefix 'heroku' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\User.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

any idea?

解决方案

It sounds like you're trying to run mvn heroku:deploy-war? You'll need to add the heroku-maven-plugin for that to work. Here's a guide: https://devcenter.heroku.com/articles/deploying-java-applications-with-the-heroku-maven-plugin

这篇关于从IntelliJ IDEA部署Java Web应用程序到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆