Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find org.springframework.boot:spring-boot-starter-velocity

I'm new to spring and trying to use velocity with spring boot.

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')
}

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:.
like image 973
sungyong Avatar asked Aug 07 '18 07:08

sungyong


People also ask

Does Spring Boot 2 support 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. 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.

What does [error] mean in the Spring Boot-CLI?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:2.18:verify (default) on project spring-boot-cli: There are test failures. [ERROR] Please refer to /Users/davidlaxer/spring-boot/spring-boot-cli/target/failsafe-reports for the individual test results.

What is the best Spring Boot starter for beginners?

[INFO] Spring Boot Jetty Starter .......................... SUCCESS [ 3.551 s] [INFO] Spring Boot JOOQ Starter ........................... SUCCESS [ 4.652 s] [INFO] Spring Boot Atomikos JTA Starter ................... SUCCESS [ 4.487 s] [INFO] Spring Boot Bitronix JTA Starter ................... SUCCESS [ 4.620 s]

What version of Gradle is used in Spring Boot boot?

Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.2.8.BUILD-SNAPSHOT. Tooling API is using target Gradle version: 1.12.


Video Answer


1 Answers

Most probably you forgot to include Spring's dependency management plugin.

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

Also make sure that you have specified the Spring Boot version to use:

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

See https://docs.spring.io/spring-boot/docs/2.0.4.RELEASE/gradle-plugin/reference/html/ for more information

like image 186
Nikem Avatar answered Sep 17 '22 15:09

Nikem