找不到org.springframework.boot:spring-boot-starter-velocity [英] Could not find org.springframework.boot:spring-boot-starter-velocity
问题描述
我刚接触弹簧,并尝试在弹簧靴中使用速度.
I'm new to spring and trying to use velocity with spring boot.
这是我的build.gradle
Here is my build.gradle
repositories {
mavenCentral()
}
plugins {
id 'org.springframework.boot' version '2.0.4.RELEASE'
}
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-velocity')
runtime('org.springframework.boot:spring-boot-devtools')
providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
当我通过./gradlew bootRun
同步时,它返回了如下错误.
When I sync by ./gradlew bootRun
, it returned error as below.
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find org.springframework.boot:spring-boot-starter-velocity:.
推荐答案
Spring Boot 2.0依赖于Spring Framework 5.0.其中放弃了对Velocity的支持.因此,在Spring Boot 2中,不再支持Velocity.
Spring Boot 2.0 depends on Spring Framework 5.0. Which dropped support for Velocity. Hence in Spring Boot 2 there is no more support for Velocity.
如果您确实需要Velocity,则必须坚持使用Spring Boot 1.5.如果您可以使用Freemarker或Moustache之类的工具,则最好使用该工具.
If you really need Velocity you would have to stick with Spring Boot 1.5. If you can move to something like Freemarker or Mustache you are probably better of using that.
这篇关于找不到org.springframework.boot:spring-boot-starter-velocity的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!