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

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

Introduction

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

Prototype

public String getArtifactId() 

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();/*w ww  .  ja v a  2 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);
    }
}