There is no main manifest attribute in spring-boot-01-helloworld-1.0-SNAPSHOT.jar

in pom.xml

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.3.4.RELEASE</version>
            </plugin>
        </plugins>
    </build>

Add to

                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>

After modification, it is

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

Repackage the jar package again and add files ending with original in the target.

Then re-execute java -jar spring-boot-01-helloworld-1.0-SNAPSHOT.jar.

 

Guess you like

Origin blog.csdn.net/qq_55888300/article/details/131029114