public final class PomHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
PomHelper() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Element |
addOrUpdateDependency(org.w3c.dom.Element depsEl,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.lang.String type,
java.lang.String scope,
java.lang.String classifier)
null in any value parameter mean remove the element.
|
static org.eclipse.ltk.core.refactoring.TextChange |
createChange(org.eclipse.core.resources.IFile file,
PomEdits.Operation operation,
java.lang.String label)
by default will create a change that won't save files with opened documents
|
static org.eclipse.ltk.core.refactoring.TextChange |
createChange(org.eclipse.core.resources.IFile file,
PomEdits.Operation operation,
java.lang.String label,
boolean forceSave) |
static org.w3c.dom.Element |
createDependency(org.w3c.dom.Element parentList,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
creates and adds new dependency to the parent.
|
static org.w3c.dom.Element |
createPlugin(org.w3c.dom.Element parentList,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
creates and adds new plugin to the parent.
|
static java.util.List<org.w3c.dom.Element> |
findDependencies(org.w3c.dom.Element node)
node is expected to be the node containing
|
static org.w3c.dom.Element |
findDependency(org.w3c.dom.Document document,
org.apache.maven.model.Dependency dependency) |
private static boolean |
isOpened(org.eclipse.jface.text.IDocument document) |
public static org.w3c.dom.Element findDependency(org.w3c.dom.Document document, org.apache.maven.model.Dependency dependency)
private static boolean isOpened(org.eclipse.jface.text.IDocument document)
public static org.eclipse.ltk.core.refactoring.TextChange createChange(org.eclipse.core.resources.IFile file, PomEdits.Operation operation, java.lang.String label, boolean forceSave) throws org.eclipse.core.runtime.CoreException
file
- operation
- label
- forceSave
- if true will save all files, no matter if associated document is opened in editor area or not.org.eclipse.core.runtime.CoreException
public static org.eclipse.ltk.core.refactoring.TextChange createChange(org.eclipse.core.resources.IFile file, PomEdits.Operation operation, java.lang.String label) throws org.eclipse.core.runtime.CoreException
file
- operation
- label
- org.eclipse.core.runtime.CoreException
public static org.w3c.dom.Element createPlugin(org.w3c.dom.Element parentList, java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
parentList
- groupId
- null or valueartifactId
- never nullversion
- null or valuepublic static org.w3c.dom.Element createDependency(org.w3c.dom.Element parentList, java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
parentList
- groupId
- null or valueartifactId
- never nullversion
- null or valuepublic static java.util.List<org.w3c.dom.Element> findDependencies(org.w3c.dom.Element node)
node
- public static org.w3c.dom.Element addOrUpdateDependency(org.w3c.dom.Element depsEl, java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, java.lang.String scope, java.lang.String classifier)
depsEl
- groupId
- artifactId
- version
- type
- scope
- classifier
-