The fat jar must have a manifest with:
Main-Class set to io.vertx.core.Starter
Main-Verticle specifying the main verticle (fully qualified name)
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
But there are two ways in regards to Vert.x how to set that up. One where it runs the Verticle you want as your "startup" verticle, and the other where you just call a class that has a static void main in it.
And the docs just represent the first way.
On 26/06/15 19:00, bytor99999 wrote:
But there are two ways in regards to Vert.x how to set that up. One where it runs the Verticle you want as your "startup" verticle, and the other where you just call a class that has a static void main in it.
Whether you're using Spring Boot, Vert.x or any other framework, a fatjar is simply an executable jar that contains the application's dependencies and a manifest which tells the JVM what the main class is. None of that is Vert.x specific.
It's completely up to you what you decide to use as your main class. If you want to run Vert.x completely embedded as in the "maven-simplest" and "gradle-simplest" examples in the examples repository then you can just write your own main class and just use that.
But of course, Vert.x comes with its own main class called io.vertx.core.Starter - and that's exactly the same main class that gets run when you install Vert.x on your path and run Vert.x on the command line with "vertx run".
So, if you're writing your code as verticles then it makes sense to just use that! You could write your own main class and call vertx.deployVerticle() in it, but that's pretty much what Starter does anyway, plus it handles all the command line args for you.
The examples "maven-verticle" and "gradle-verticle" in the examples repo show examples of using Starter as your main class.
And the docs just represent the first way.
Which docs are you referring to?
On Friday, June 26, 2015 at 11:24:48 AM UTC-7, Tim Fox wrote:On 26/06/15 19:00, bytor99999 wrote:
But there are two ways in regards to Vert.x how to set that up. One where it runs the Verticle you want as your "startup" verticle, and the other where you just call a class that has a static void main in it.
Whether you're using Spring Boot, Vert.x or any other framework, a fatjar is simply an executable jar that contains the application's dependencies and a manifest which tells the JVM what the main class is. None of that is Vert.x specific.
It's completely up to you what you decide to use as your main class. If you want to run Vert.x completely embedded as in the "maven-simplest" and "gradle-simplest" examples in the examples repository then you can just write your own main class and just use that.
But of course, Vert.x comes with its own main class called io.vertx.core.Starter - and that's exactly the same main class that gets run when you install Vert.x on your path and run Vert.x on the command line with "vertx run".
So, if you're writing your code as verticles then it makes sense to just use that! You could write your own main class and call vertx.deployVerticle() in it, but that's pretty much what Starter does anyway, plus it handles all the command line args for you.
The examples "maven-verticle" and "gradle-verticle" in the examples repo show examples of using Starter as your main class.
And the docs just represent the first way.
Which docs are you referring to?
Vert.x 3.0 Documentation.
And that is my only point. Is that there are different ways to make your fat-jar run your Vert.x application an that the documentation should represent and say that. But it only says one thing, Main class is Starter and Main-verticle needs to be set.
My only point is that the documentation has to be updated so that people like me that just don't get it and spend days trying to get the simplest thing to just work.
Yes, it took me days to realize this and get my fatjar Vert.x application just to start up. Unfortunately, and I have been in the same position, that you are too close to the code and how things work, that you take a lot of things for granite on what should be "common" easy to see knowledge, that really isn't.
Something as common and stupid as running java -jar is small and common knowledge by itself. But when you add one thing like Vert.x to the mix, and the Vert.x documentation says it only one way,
Yeah, it is just to make the docs clearer. I understand that both ways are fine, both ways work. I just got confused by the docs. And since we are using Maven, we wouldn't have looked at the gradle example project.
On 28/06/15 19:31, bytor99999 wrote:
Yeah, it is just to make the docs clearer. I understand that both ways are fine, both ways work. I just got confused by the docs. And since we are using Maven, we wouldn't have looked at the gradle example project.
I said Gradle because I thought you were using Gradle, but if you're using the Maven, there's one for that too!
Start from the docs page:
http://vertx.io/docs/http://vertx.io/docs/
I know that maven simplest is there. This isn't about that. Most people first go to the documentation and read that. That is all I did. I typically don't go through examples because they are just that, too simple of examples. Our examples are a perfect example of too simple and not matching what we have in the "real" world.
And it is understandable, you want to have the simplest smallest example that completely demonstrates that one thing it is showing.
But, for example all the Groovy vertx-unit examples and tests are all based on vertx-unit Groovy, but none of them demonstrated integration with JUnit.
I know that maven simplest is there. This isn't about that. Most people first go to the documentation and read that. That is all I did. I typically don't go through examples because they are just that, too simple of examples. Our examples are a perfect example of too simple and not matching what we have in the "real" world.
And it is understandable, you want to have the simplest smallest example that completely demonstrates that one thing it is showing.
But, for example all the Groovy vertx-unit examples and tests are all based on vertx-unit Groovy, but none of them demonstrated integration with JUnit. Well we have hundreds of JUnit Integration tests that need to be converted to the new vertx-unit. The examples were great, but showed me nothing of what I needed to change. It took many days to get it correct, because the examples and documentation did NOT get us 100% there. Maybe about 40-50% there.
There is NOTHING wrong with that. I am just trying to help to make the documentation and then examples that much better to get us closer.
This problem happens in most projects, the developers are too close to the code to be able to write detailed documentation covering areas that are fully needed because you have to take certain things for granite, or what seems like common sense to the developer. But is difficult for someone on the outside to see or understand.
Call us newbies, simpletons, or whatever, but sometimes what seems simple and easy for the developer of the project is NOT to those trying to use it in their applications.
Sorry Mark, I have to disagree here.
Docs can always be improved, but we specifically have a "Get Started" section right at the beginning of the docs, where the first link would have taken you exactly where you wanted to go and prevented "days" of you trying to figure out how to do it.