Jar execution using maven

272 Views Asked by At

I am working on swagger swagger-codegen , so below command to be executed to generate static html files,

java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i http://localhost:8086/swagger.json -l java -o samples/client/petstore/java

My problem is how can i trigger above command using maven.

i tried with exec-maven-plugin it is asking for main class, but i am not sure on the main class(i mean which is main class and where it is)

Please help.

1

There are 1 best solutions below

6
On

The main class is SwaggerCodegen.java, as you can see it contains the method:

public static void main (String [] args)

https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/SwaggerCodegen.java