Unable to run Vertx fat jar on the intranet

114 views
Skip to first unread message

Michael Smolyak

unread,
Mar 20, 2015, 10:18:44 AM3/20/15
to ve...@googlegroups.com
I have a Vertx application using Groovy,which I am trying to distribute as a fat jar. I have no trouble running the main verticle or running the main module using 'vertx' command, which uses local Vertx 2.1.5 installation. 

I am also able to build a fat JAR file using either 'gradle fatjar' or 'vertx fatjar' command. The problem is with running the fatjar thus created. The error message I get is

SEVERE: Module io.vertx~lang-groovy~2.1.1-final not found in any repositories.

I am in the intranet environment without access to global Maven repositories. I have a local Vertx installation (which contains the groovy-lang module in question). The module is not bundled in the fatjar file, which I assume is the problem. I added the module to the local Nexus repo (which is a tricky task, since it is not immediately clear what artifact needs to be in Nexus).

Where does Vertx looks for the groovy-lang module during fatjar creation? Do I need to include it inNexus or should Vertx be able to find it under Vertx installation? How to resolve the problem of the missing module?

Thank you,

Michael

Tim Fox

unread,
Mar 20, 2015, 11:11:09 AM3/20/15
to ve...@googlegroups.com
You need to include the groovy lib in your module as a nested module.

See
http://vertx.io/mods_manual.html#nested-modules-packaging-all-module-dependencies-in-the-module

You do this by adding a "deploys" field in mod.json.

If you are using the standard Gradle template you can just set the
"pullInDeps" flag to true, iirc

Michael Smolyak

unread,
Mar 20, 2015, 2:16:43 PM3/20/15
to ve...@googlegroups.com
Tim, thank you for the prompt reply. Finally the application is running in a fat-jar mode. Her is what I had to do:
  • Add lang-groovy module to "deploys" property
  • pulInDeps in gradle.properties was already set to true, so I did not have to change it
  • Correctly add the ZIP file containing the groovy-lang module to my local Nexus repo. This was a somewhat tricky step since it is not documented anywhere (it is not obvious that the module should be in a repository in addition to being in the Vertx installation), nor there is a ZIP file that you can add - I had to build it from the module inside the sys-mods directory in Vertx installation.
  • I also had to include lang-rhino module since one of the Verticles is written in JavaScript (I am still having troubles with it when running from fat jar).
Michael
Reply all
Reply to author
Forward
0 new messages