Example usage for org.springframework.ide.eclipse.boot.core Bom getVersion

List of usage examples for org.springframework.ide.eclipse.boot.core Bom getVersion

Introduction

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

Prototype

public String getVersion() 

Source Link

Usage

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

private static Element createBom(Element parentList, Bom bom) {
    /*/*  w  ww  .j a  v  a  2s .co m*/
    <dependencyManagement>
    <dependencies> <---- parentList
       <dependency> <---- create and return
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-parent</artifactId>
    <version>Brixton.M3</version>
    <type>pom</type>
    <scope>import</scope>
       </dependency>
    </dependencies>
    </dependencyManagement>
     */

    String groupId = bom.getGroupId();
    String artifactId = bom.getArtifactId();
    String version = bom.getVersion();
    String classifier = bom.getClassifier();
    String type = "pom";
    String scope = "import";

    Element dep = createElement(parentList, DEPENDENCY);

    if (groupId != null) {
        createElementWithText(dep, GROUP_ID, groupId);
    }
    createElementWithText(dep, ARTIFACT_ID, artifactId);
    if (version != null) {
        createElementWithText(dep, VERSION, version);
    }
    createElementWithText(dep, TYPE, type);
    if (scope != null && !scope.equals("compile")) {
        createElementWithText(dep, SCOPE, scope);
    }
    if (classifier != null) {
        createElementWithText(dep, CLASSIFIER, classifier);
    }
    format(dep);
    return dep;
}