1,如果你的POM是继承spring-boot-starter-parent的话,只需要下面的指定就行。

<properties>
    <!-- The main class to start by executing java -jar -->
    <start-class>com.mycorp.starter.HelloWorldApplication</start-class>
</properties>

2,如果你的POM不是继承spring-boot-starter-parent的话,需要下面的指定。

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <layout>ZIP</layout>
        <executable>true</executable>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>repackage</goal>
            </goals>
        </execution>
    </executions>
</plugin>

另外,打包相关的名字一定要相同,不然找不到路径。

相关文章:

  • 2022-12-23
  • 2021-07-08
  • 2021-05-02
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-03
  • 2021-12-26
  • 2021-10-16
  • 2021-04-03
  • 2021-12-06
  • 2021-06-16
  • 2021-08-20
相关资源
相似解决方案