简体   繁体   English

创建Spring Boot应用程序时出现问题

[英]Problem with creating a Spring Boot Application

i am still a beginner with spring boot, and i have a bunch of questions. 我仍然是初学者,但我有很多问题。 First of all, do i have to download maven in my pc and add it to my pc path envirement to make spring boot work correctly ? 首先,我是否必须在PC中下载Maven并将其添加到PC路径环境中才能使Spring Boot正常工作? Secondly, Spring boot wasn't able to work, was doing a hello world app and there were lot of errors on the console one of them is "SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".. why that ? i looked for the error and followed some mvn command line steps "mvn dependency:purge-local-repository", and my app finally worked.. but do i have to run this command everytime i create a spring boot app ? isn't everything supposed to be alright since it's only a hello world app ? .. Thank you 其次,Spring引导无法正常工作,正在做一个hello world应用程序,并且控制台上存在很多错误,其中之一是“ SLF4J:无法加载类” org.slf4j.impl.StaticLoggerBinder”。我寻找了错误,并遵循了一些mvn命令行步骤“ mvn依赖项:purge-local-repository”,我的应用程序终于可以工作了。但是我每次创建spring boot应用程序时都必须运行此命令吗?一切都应该没事,因为它只是一个hello world应用程序..谢谢

Yes, you need to have installed maven or gradle in order to run your application. 是的,您需要安装maven或gradle才能运行您的应用程序。 And it needs to be reachable, so you have to configure your system variables accordingly. 而且它必须是可访问的,因此您必须相应地配置系统变量。

You can find more details here . 您可以在此处找到更多详细信息。

As per the maven error, maven keeps all the artifacts you need to run your application in a shared folder with all versions, sometimes maven could have corrupted files or a mismatch in version so you need to purge the repository and download artifacts again. 根据maven错误,maven将运行应用程序所需的所有工件保存在所有版本的共享文件夹中,有时maven可能存在文件损坏或版本不匹配的情况,因此您需要清除存储库并再次下载工件。

You can find a more detailed answer here . 您可以在此处找到更详细的答案。

Even when you are coding a simple application, spring-boot bring up a lot of code for supporting operations you may require, such code is self configured and hidden. 即使在编写简单应用程序的代码时,spring-boot也会带来很多代码来支持您可能需要的操作,这些代码是自配置的并且是隐藏的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM