swagger-api / swagger-api/swagger-codegen
Spring MVC - mvn package leads to "no main manifest attribute"
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Start by examining the generated Spring MVC server's Maven packaging configuration and how mvn package produces the JAR, then compare it with the mvn jetty:run entry point; done means the supported way to launch the generated server is clear and the reported JAR behavior is resolved or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100