バージョン情報
- JDK 1.8.0_172
- Gradle 4.10
解決したいこと
HerokuにSpringBootで作ったアプリをデプロイしようとしたのですが、
下記のエラーが出てソースコードのpushに失敗します。
-----> Gradle Wrapper app detected -----> Installing OpenJDK 1.8... done -----> Building Gradle app... WARNING: The Gradle buildpack is currently in Beta. -----> executing ./gradlew Downloading https://services.gradle.org/distributions/gradle-4.10-all.zip ............................................................................................................... Welcome to Gradle 4.10! Here are the highlights of this release: - Incremental Java compilation by default - Periodic Gradle caches cleanup - Gradle Kotlin DSL 1.0-RC3 - Nested included builds - SNAPSHOT plugin versions in the `plugins {}` block For more details see https://docs.gradle.org/4.10/release-notes.html Starting a Gradle Daemon (subsequent builds will be faster) FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'KakeiboApp'. > Could not resolve all artifacts for configuration ':classpath'. > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE. Required by: project : > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE. > Could not get resource 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.0.5.RELEASE/spring-boot-gradle-plugin-2.0.5.RELEASE.pom'. > Could not GET 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/2.0.5.RELEASE/spring-boot-gradle-plugin-2.0.5.RELEASE.pom'. > Received fatal alert: protocol_version * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 12s ! Failed to build app ! Push rejected, failed to compile Gradle Wrapper app. ! Push failed
build.gradleに記載したspring-boot-gradle-plugin
が取得できていないようなのですが、
どのように修正すればよいのか分からずに詰まっています。
もし解決策をご存知の方がいらっしゃいましたら、ご教示頂けますと幸いです。
各種設定ファイル
build.gradle
buildscript { repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.5.RELEASE") } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management' bootJar { baseName = 'gs-serving-web-content' version = '0.1.0' } repositories { mavenCentral() } sourceCompatibility = 1.8 targetCompatibility = 1.8 dependencies { compile("org.springframework.boot:spring-boot-starter-web") compile("org.springframework.boot:spring-boot-starter-thymeleaf") compile("org.springframework.boot:spring-boot-devtools") compile("org.springframework.boot:spring-boot-starter-jetty") // JPA Data (We are going to use Repositories, Entities, Hibernate, etc...) compile 'org.springframework.boot:spring-boot-starter-data-jpa' // Use MySQL Connector-J compile 'mysql:mysql-connector-java' compile 'postgresql' testCompile("junit:junit") } //デプロイ時のデフォルトタスク defaultTasks "clean", "build" task stage(dependsOn: ['build', 'clean']) build.mustRunAfter clean
system.properties
java.runtime.version=1.8.0_172
Procfile
web: java -jar build/libs/KakeiboApp-1.0.jar --server.port=$PORT
ディレクトリ構成
. ├── .gitignore ├── .system.properties ├── Procfile ├── build.gradle ├── setting.gradle ├── gradlew ├── build │ ├── classes │ │ └── java │ │ └── main │ │ └── income_outgo │ ├── libs │ ├── resources │ │ └── main │ │ ├── static │ │ │ ├── css │ │ │ ├── img │ │ │ └── js │ │ └── templates │ │ ├── category │ │ └── income_outgo │ └── tmp │ ├── bootJar │ └── compileJava ├── gradle │ └── wrapper ├── out │ └── production └── src ├── main │ ├── java │ │ └── income_outgo │ └── resources │ ├── static │ │ ├── css │ │ ├── img │ │ └── js │ └── templates │ ├── category │ └── income_outgo └── test ├── java └── resources
あなたの回答
tips
プレビュー