Example usage for org.springframework.ide.eclipse.boot.core SpringBootCore getDefaultBootVersion

List of usage examples for org.springframework.ide.eclipse.boot.core SpringBootCore getDefaultBootVersion

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.core SpringBootCore getDefaultBootVersion.

Prototype

public static String getDefaultBootVersion() 

Source Link

Document

Normally we determine the version of spring boot used by a project based on its classpath.

Usage

From source file:org.springframework.ide.eclipse.boot.core.internal.MavenSpringBootProject.java

@Override
public String getBootVersion() {
    try {/*  w w  w  .jav a  2 s .  c  om*/
        MavenProject mp = getMavenProject();
        if (mp != null) {
            return getBootVersion(mp.getDependencies());
        }
    } catch (Exception e) {
        BootActivator.log(e);
    }
    return SpringBootCore.getDefaultBootVersion();
}

From source file:org.springframework.ide.eclipse.boot.core.internal.MavenSpringBootProject.java

private String getBootVersion(List<Dependency> dependencies) {
    for (Dependency dep : dependencies) {
        if (dep.getArtifactId().startsWith("spring-boot")
                && dep.getGroupId().equals("org.springframework.boot")) {
            return dep.getVersion();
        }/*from   w w  w.  ja v  a2  s  .  co  m*/
    }
    return SpringBootCore.getDefaultBootVersion();
}