Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我在 SpringBoot 中创建任何项目时,该项目会出现以下错误:“无法找到或加载主类”。但是,当我运行任何其他旧项目时,它可以正常工作。
您第一次可能遇到了问题,并且您的本地 jar 可能会被破坏,因此看起来您的 .m2 依赖项下载不正确。
执行mvn dependency:purge-local-repository删除你的本地仓库然后执行mvn clean package
mvn dependency:purge-local-repository
mvn clean package
右键单击您的项目 -> Maven -> 更新项目...