当我的spring-boot代码被执行时,我得到如下错误:
未能对项目projectName执行目标org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:run (默认值-cli):找不到合适的主类,请添加“”mainClass“”属性
我该如何解决这个问题呢?
发布于 2019-02-08 01:20:17
将主类添加到插件配置中
<build>
...
<plugins>
...
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>your.class.with.main.Method</mainClass>
</configuration>
</plugin>
...
</plugins>
...
</build>来源:https://docs.spring.io/spring-boot/docs/current/maven-plugin/usage.html
https://stackoverflow.com/questions/54577985
复制相似问题