Home > Java > javaTutorial > How to solve the problem that there is no main manifest attribute in SpringBoot

How to solve the problem that there is no main manifest attribute in SpringBoot

王林
Release: 2023-05-22 19:43:04
forward
4021 people have browsed it

Solution: SpringBoot has no main manifest attribute

Problem: After SpringBoot is packaged into a jar and run, it prompts that there is no main manifest attribute

Solution: Complete the maven bulid information

<plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>repackage</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
Copy after login

Reason:

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

caused the configuration items of spring-boot-maven-plugin to be lost, causing the MANIFEST.MF file in the packaged jar to lack Main-Class.

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

The above is the detailed content of How to solve the problem that there is no main manifest attribute in SpringBoot. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template