swagger-api/swagger-codegen

Spring MVC - mvn package leads to "no main manifest attribute"

Open

#2,345 建立於 2016年3月9日

在 GitHub 查看
 (8 留言) (3 反應) (0 負責人)HTML (12,701 star) (5,474 fork)batch import
Issue: BugServer: Springhelp wanted

描述

Hi,

I have a Spring MVC server generated using Swagger.. And normally, to start it we use mvn jetty:run.. But I'd like to create a JAR file that I can launch afterwards.. So, to do that, I use the command mvn package and it creates correctly the JAR file in the target folder.

But when I try to start it using the command java -jar swagger-spring-mvc-server-1.0.0.jar, I get this error: no main manifest attribute, in swagger-spring-mvc-server-1.0.0.jar.

If I'm right, this problem happens because the Main.class is missing.. But I didn't find any main classes in the generated code.

Does anyone knows if I'm doing something wrong?? Or if there's another way to get the JAR file? Thanks

貢獻者指南

Spring MVC - mvn package leads to "no main manifest attribute" · swagger-api/swagger-codegen#2345 | Good First Issue