2024 Nov 02 2:02 PM - edited 2024 Nov 02 2:09 PM
Dear all. First of all, I would like to say to you.
I have an application that is being built with Kotlin on the server side and I am trying to verify if it can run on BTP Cloud Foundry.
Currently I am able to deploy it but the status is error.
I expect it is probably the contents of manifest.yml.
I will give the following details.
I am a beginner and my goal is to display Hello World.
----
Do the following
push -f manifest.yml -b sap_java_buildpack
2024-11-02T20:15:32.05+0900 [APP/PROC/WEB/0] ERR bash: line 1: java: command not found
java 17.0.12
manifest.yml
---
applications:
- name: demo
no-route: true
buildpacks:
- sap_java_buildpack
path: build/libs/demo-0.0.1-SNAPSHOT.jar
build.gradle
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.9.25'
id 'org.jetbrains.kotlin.plugin.spring' version '1.9.25'
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.1.6'
id 'application'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'
implementation 'org.jetbrains.kotlin:kotlin-reflect'
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll '-Xjsr305=strict'
}
}
tasks.withType(Jar).all {
duplicatesStrategy 'exclude'
}
jar {
enabled = true
archiveClassifier = ''
}
jar {
from {
configurations.compileClasspath.collect { // .jarファイルに含める
it.isDirectory() ? it : zipTree(it)
}
}
}
jar {
manifest {
attributes 'Main-Class': 'com.example.demo.DemoApplicationKt'
}
}
DemoApplication.kt
package com.example.demo
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
fun main(args:Array<String>){
println("Hello Kotlin")
}
Request clarification before answering.
User | Count |
---|---|
74 | |
30 | |
9 | |
7 | |
7 | |
6 | |
6 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.