【发布时间】:2019-03-31 21:02:27
【问题描述】:
按照 Spring-Boot 教程,尝试使用 $ mvn spring-boot:run 运行,出现错误:“无法找到合适的主类...”我该如何超越?
(使用 Ubuntu)
我已按照本教程尝试使用 Spring-Boot:
直到 11.4。当我进入
$ mvn spring-boot:run
我最终得到了这个错误:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) on project myproject: Unable to find a suitable main class, please add a 'mainClass' property
我以为我已经按照每个方向去了 T。应该在这一步运行的 Example.java 位于此处,
folder/src/main/java/Example.java
名为“文件夹”的文件夹包含 maven 的 pom 文件以及其他所有文件。 Maven 读取该 pom 文件没有任何问题。
来自堆栈跟踪:
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to find a suitable main class, please add a 'mainClass' property
我该怎么办?所有其他问题似乎都与目录结构或更复杂的东西有关。我这里哪里出错了?
【问题讨论】:
标签: xml maven spring-boot ubuntu installation