出现这个问题的原因是 pom 中没有添加主程序入口

在配置中添加如下配置

        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <!-- 此处为程序主入口-->
                            <mainClass>com.oak.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
        </plugin>

即可

相关文章:

  • 2022-12-23
  • 2021-10-12
  • 2022-12-23
  • 2021-07-24
  • 2021-11-27
  • 2022-12-23
  • 2023-02-25
  • 2021-08-01
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案