Spring boot 提供一个能够成功运行它的样本是如此困难,还是仅仅spring很难自然使用?

Spring boot 提供一个能够成功运行它的样本是如此困难,还是仅仅spring很难自然使用?,spring-boot,Spring Boot,我克隆了spring boot,想启动spring boot示例web ui,将其导入intellij idea并运行SampleWebUiApplication后,首先遇到了这个错误 Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory 然后添加了这个依赖项 <dependency> <groupId>org.apache.tomcat.e

我克隆了
spring boot
,想启动
spring boot示例web ui
,将其导入intellij idea并运行
SampleWebUiApplication
后,首先遇到了这个错误

Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
然后添加了这个依赖项

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-logging-juli</artifactId>
    </dependency>

提供一个能成功启动的样品是如此困难还是仅仅是弹簧很难自然使用

如果您是Spring/Spring Boot新手,建议的方法是查看。我还没有遇到一个问题,其中之一,并让他们正常工作。根据你列出的样品,我猜这将是一个很好的一看


我确实在本地环境中使用Eclipse尝试了spring boot示例web ui项目。我没有遇到任何问题,所以看起来可能是您在IntelliJ中导入/加载项目的方式有问题。

我通过在pom中更改父项解决了这个问题

        <parent>
-               <!-- Your own application should inherit from spring-boot-starter-parent -->
                <groupId>org.springframework.boot</groupId>
-               <artifactId>spring-boot-samples</artifactId>
-               <version>1.4.0.BUILD-SNAPSHOT</version>
+               <artifactId>spring-boot-starter-parent</artifactId>
+               <version>1.4.0.RELEASE</version>
        </parent>

-               
org.springframework.boot
-弹簧靴样品
-1.4.0.1构建快照
+spring启动程序父级
+1.4.0.1发布

不知道这个示例是从哪里得到的,但我认为任何示例都不适用于快照构建版本。
        <parent>
-               <!-- Your own application should inherit from spring-boot-starter-parent -->
                <groupId>org.springframework.boot</groupId>
-               <artifactId>spring-boot-samples</artifactId>
-               <version>1.4.0.BUILD-SNAPSHOT</version>
+               <artifactId>spring-boot-starter-parent</artifactId>
+               <version>1.4.0.RELEASE</version>
        </parent>