Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenShift Hello World java vertical

I'm trying to create a simple "Hello World" vertx java application on OpenShift, but somehow my class can not be found/run.

I have created a new app on OpenShift and cloned the git repository, from there I have added my sample Test.java class.

Also I have added to the /configuration/vertx.env file

export vertx_module=com.test~project~1.0

in my pom.xml I have

<artifactId>project</artifactId>
<groupId>com.test</groupId>
<version>1.0</version>

I also tried and added the following to the /mods/mod.json file

{
  "main": "com.test.project.Test"
}

.... What am I missing, or otherwise said, how should be the project structured (on OpenShift) in order to make vertx run my simple Test.class ?

Or is there maybe an additional maven step that must be taken inside the pom.xml?

like image 253
Drejc Avatar asked Sep 12 '26 16:09

Drejc


1 Answers

Ok ... it seems that currently the vertx catridge doesn't run a maven build after git push. This is somehow broken (at least for Java).

To get your Java module running you need to log into your app via OpenShift console and then:

  1. run the maven build for your vertx java module (this will put the correct files into the maven .m2 folder and vertx will find it). Files are stored in: ~/app-root/repo

  2. restart vertx:

    sh ~/vertx/bin/control restart
    

Hopefully will OpenShift automate this steps in the future.

like image 184
Drejc Avatar answered Sep 14 '26 07:09

Drejc