代码之家  ›  专栏  ›  技术社区  ›  sungyong

找不到org.springframework.boot:springbootstartervelocity

  •  2
  • sungyong  · 技术社区  · 6 年前

    我对spring还不熟悉,我想用velocity和spring boot来配合使用。

    这是我的身材。格雷德

    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 ,返回错误如下。

    > 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:.
    
    2 回复  |  直到 6 年前
        1
  •  3
  •   M. Deinum    6 年前

    SpringBoot2.0依赖于SpringFramework5.0。哪个 dropped support for Velocity . 因此,在SpringBoot2中不再支持Velocity。

    如果你真的需要速度,你将不得不坚持与弹簧靴1.5。如果你可以移动到自由标记或胡子之类的东西,你可能会更好地使用它。

        2
  •  7
  •   Nikem    6 年前

    很可能你忘了包括Spring的依赖管理插件。

    apply plugin: 'io.spring.dependency-management'

    还要确保指定了要使用的Spring引导版本:

    plugins { id 'org.springframework.boot' version '2.0.4.RELEASE' }

    https://docs.spring.io/spring-boot/docs/2.0.4.RELEASE/gradle-plugin/reference/html/ 了解更多信息