java - 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'
}
我正在尝试部署项目并且出现此消息,有人知道如何解决吗?
解决方案
由于罕见的隐藏字符(Windows 风格),我认为您的脚本是错误的。使用dos2unix修复它再次上传到heroku:
dos2unix build.gradle
为基于 debian 的发行版安装 dos2unix
sudo apt-get install dos2unix
或者
sudo yum install dos2unix
对于 RH 发行版
推荐阅读
- caching - Lighthouse:使用高效的缓存策略服务静态资产
- java - zip4j可以用来解压tar文件吗?
- r - Shiny - 使用 for 循环插入 UI 会在每个输出中返回相同的元素
- azure - Azure 中 docker compose 的存储卷在哪里?
- javascript - Mongoose 虚拟填充返回 null
- javascript - 类型错误:balance.toNumber 不是函数
- android - 在升序和降序之间切换项目排序时如何为recyclerview内容更改设置动画
- json - Python3 // JSON 返回 API 上未编码的字符
- azure-devops - 通知策略绕过
- mysql - 为什么“SELECT ... WHERE id=1=0”会返回除 id=1 之外的所有行?