Get the App
SLTechnology News&Howtos  ›  Development  › 

What if SpringBoot does not have the main list attribute?

Shulou Source: shulou.com Published: 2022-06-03 09:57:03 11月15日 Update

This article mainly introduces how to do without the main list attribute of SpringBoot, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.

Resolve that SpringBoot does not have a master list attribute

Problem: after SpringBoot is packaged into jar, the run prompt does not have the main list attribute.

Solution: complete the bulid information in maven

Org.springframework.boot spring-boot-maven-plugin ${spring.version} repackage

Reason:

Because I use spring-boot-dependencies BOM instead of spring-boot-starter-parent parent POM (see 13.2.2 for details. Using Spring Boot without the parent POM)

As a result, the configuration item for spring-boot-maven-plugin is lost, and the MANIFEST.MF file in the packaged jar is missing Main-Class.

PS: when the packaging type is jar, the packaging process for spring-boot-maven-plugin is completely different from using maven-jar-plugin directly. The structure of the generated jar directory is also very different.

Thank you for reading this article carefully. I hope the article "what to do without the main list attribute of SpringBoot" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Attributes lists articles what to do different great value information interests reasons at the same time files more friends directories knowledge types structure tape industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology Redmi OPPO Reno Shulou Information