Heroku无法部署

时间:2020-08-08 22:03:58

标签: java spring-boot heroku

-----> Gradle app detected
-----> Spring Boot detected
-----> Installing JDK 1.8... done
-----> Building Gradle app...
-----> executing ./gradlew build -x test
       /usr/bin/env: ‘sh\r’: No such file or directory
 !     ERROR: Failed to run Gradle!
       We're sorry this build is failing. If you can't find the issue in application
       code, please submit a ticket so we can help: https://help.heroku.com
       You can also try reverting to the previous version of the buildpack by running:
       $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
       
       Thanks,
       Heroku
 !     Push rejected, failed to compile Gradle app.
 !     Push failed

等级代码

    buildscript {
        ext {
            springBootVersion = '2.0.0.M7'
        }
        repositories {
            mavenCentral()
            maven { url "https://repo.spring.io/snapshot" }
            maven { url "https://repo.spring.io/milestone" }
        }
        dependencies {
            classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        }
    }
    
    apply plugin: 'java'
    apply plugin: 'eclipse-wtp'
    apply plugin: 'org.springframework.boot'
    apply plugin: 'io.spring.dependency-management'
    //apply plugin: 'jar'
    
    group = 'br.com.escconsultoria.superrifa'
    version = '0.0.1-SNAPSHOT'
    sourceCompatibility = 8
    
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
    }
    
    configurations {
        providedRuntime
    }
    
    dependencies {
        compile('org.springframework.boot:spring-boot-starter-data-jpa')
        compile('org.springframework.boot:spring-boot-starter-data-rest')
        compile('org.springframework.boot:spring-boot-starter-mail')
        //compile('org.springframework.boot:spring-boot-starter-security')
        compile('org.springframework.session:spring-session-core')
        compile('org.springframework.boot:spring-boot-starter-web')
        //runtime('mysql:mysql-connector-java')
        
        // https://mvnrepository.com/artifact/mysql/mysql-connector-java
        compile group: 'mysql', name: 'mysql-connector-java', version: '8.0.19'
        
        providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
        testCompile('org.springframework.boot:spring-boot-starter-test')
        // testCompile('org.springframework.security:spring-security-test')
        
        // https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload
        compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.3'
        
        // https://mvnrepository.com/artifact/net.sourceforge.dynamicreports/dynamicreports-core
        compile group: 'net.sourceforge.dynamicreports', name: 'dynamicreports-core', version: '5.1.0'
        
        // https://mvnrepository.com/artifact/net.sourceforge.dynamicreports/dynamicreports-parent
        compile group: 'net.sourceforge.dynamicreports', name: 'dynamicreports-parent', version: '5.1.0'
        
        // https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports
        compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.5.1'
        
        // https://mvnrepository.com/artifact/com.lowagie/itext
        compile group: 'com.lowagie', name: 'itext', version: '2.1.7'
        
        // https://mvnrepository.com/artifact/org.olap4j/olap4j
        compile group: 'org.olap4j', name: 'olap4j', version: '1.2.0'
        
        // https://mvnrepository.com/artifact/com.google.guava/guava
        compile group: 'com.google.guava', name: 'guava', version: '27.1-jre'
        
        // https://mvnrepository.com/artifact/com.google.code.gson/gson
        compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
    }

我正在尝试部署项目,并且出现此消息,有人知道如何解决吗?

1 个答案:

答案 0 :(得分:0)

我认为您的脚本是错误的,原因是罕见的隐藏字符(Windows风格)。使用 dos2unix 将其修复为再次上传到heroku:

dos2unix build.gradle

为基于debian的发行版安装dos2unix

sudo apt-get install dos2unix

sudo yum install dos2unix 

对于RH发行版

相关问题