Example usage for org.springframework.ide.eclipse.boot.core MavenId getGroupId

List of usage examples for org.springframework.ide.eclipse.boot.core MavenId getGroupId

Introduction

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

Prototype

public String getGroupId() 

Source Link

Usage

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

@Override
public void removeMavenDependency(final MavenId mavenId) {
    IFile file = getPomFile();/*from w  ww .  jav a2 s  .  c o m*/
    try {
        performOnDOMDocument(new OperationTuple(file, new Operation() {
            @Override
            public void process(Document pom) {
                Element depsEl = getChild(pom.getDocumentElement(), DEPENDENCIES);
                if (depsEl != null) {
                    Element dep = findChild(depsEl, DEPENDENCY, childEquals(GROUP_ID, mavenId.getGroupId()),
                            childEquals(ARTIFACT_ID, mavenId.getArtifactId()));
                    if (dep != null) {
                        depsEl.removeChild(dep);
                    }
                }
            }
        }));
    } catch (Exception e) {
        BootActivator.log(e);
    }
}