The executable jar that starts SpringBoot reports an error: target\spring-boot-hello-1.0-SNAPSHOT.jar does not have a main manifest attribute

  The packaging is successful, but an error is reported during execution, there is no main manifest attribute

  

solve:

  Add dependencies in the red box:

  

     
<build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
</build>

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325024871&siteId=291194637