Hello. I'm working on a pure kotlin-based web proj...
# server
n
Hello. I'm working on a pure kotlin-based web projetc. It's work fine locally and i want to deploy it on a cloud foundry. But the official Java buildpack does not work for it. Any idea on how i can make this works ? ( I created a channel for it #cloudfoundry)
g
Do you use Kotlin JVM? Do they support Java? If so what is your problem?
n
1- Yes i use Kotlin JVM, 2- The cloud foundry platform support very well Java ( i deployed another java apps on it). The ussue is that the official buildpack for Java does not work for kotlin. It seems that it support some JMV-languages but i checked and Kotlin seems to not belong to the suppoted JVM-language
g
But what exactly do you upload? Jar?
n
Is the buildpack designed to work with a major build system (Gradle, Maven etc)?
1
d
The CF jdk buildpack will work with a standard application distribution zip out of the box
n
I upload a jar
for sure the buildpack works at leaste with Gradle and maven
g
But there is no difference on jar level between Kotlin and Java
same, it’s transparent if you use Gradle or Maven
n
It's what i told to myself when i pushed the jar file ( no difference between java and Kotlin at jar level). But the cloud foundy throws this error message: ERROR Finalize failed with exception #<RuntimeError: No container can run this application. Please ensure that you've pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
g
Do you use distZip format?
I still think that there is some problem in your configuration, for example you need some config in META-INF
I mean there is no magic there, just a jar with some classes and probably META-INF to specify entry point
d
@Nykykof the easiest way to do that in gradle is to
apply plugin: 'application'
and then set a
mainClassName = 'fully.qualified.MainKt'
<-- the Kt is important if you're using a floating main function as your entry point
n
@dave i use maven. is there an equivalent ?
d
Definitely, although I can't tell you what it is because I'm not exactly a fan of maven 😉
😥 1
n
@gildor i'm going to explore the way of META-INFO
g
“way of META-INFO” this is exactly the way what @dave suggested, Gradle plugins does exactly this: configure META for you
something like this, I suppose. Just not really familiar with Maven
n
ok thanks @dave and @gildor. i will check it
f
Might want to try the #java-buildpack channel in the cloud foundry slack
It’s definitely using the java buildpack, right?
n
@fitzoh Yes it's using the java buildpack
My pom.xml was not very well configured so the manifest was also bad generated. I still having some issues (having 502 bad gateway error when consuming the APIs) but my app is now runnig on cloudfoundry thanks to @gildor ans @dave
🎉 1
👍 1