public class OpenShiftPomDeployer extends Object
Constructor and Description |
---|
OpenShiftPomDeployer(org.eclipse.jgit.api.Git git,
File baseDir,
String deployDir,
String webAppDir) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMavenCoordinates(Element owner,
io.fabric8.agent.mvn.Parser parser,
int indent) |
protected void |
addOrUpdateDependency(Element dependencies,
io.fabric8.agent.mvn.Parser parser) |
protected void |
addRepositoryFlag(Element repository,
String flagElementName,
boolean flag) |
static Text |
appendText(Element owner,
String text) |
static Element |
createAndAppendChild(Element owner,
String elementName,
int indent) |
static Element |
createAndAppendChild(Element owner,
String elementName,
int indent,
boolean forceWhitespace) |
static Element |
createAndAppendChild(Element owner,
String elementName,
int indent,
String text) |
protected void |
detachElement(Element answer) |
protected Element |
getOrCreateChild(Element owner,
String elementName,
int indent) |
protected Element |
getOrCreateChild(Element owner,
String elementName,
int indent,
boolean forceWhitespace)
Gets the first child with the given element name or adds a new one if its missing
|
protected Element |
getOrCreateOpenShiftProfilePlugins(Element project) |
protected Element |
getOrCreatePlugin(Element plugins,
String artifactId,
String version) |
protected Element |
getPlugin(Element plugins,
String artifactId) |
static String |
groupId(io.fabric8.agent.mvn.Parser parser) |
protected Element |
recreateDependencyExecution(Element executions,
Element dependencies,
String executionId,
String outputDir,
List<io.fabric8.agent.mvn.Parser> list,
boolean isWar) |
void |
update(Collection<io.fabric8.agent.mvn.Parser> artifacts,
List<io.fabric8.agent.mvn.MavenRepositoryURL> repos) |
protected void |
updateCleanPlugin(Element plugins)
Lets make sure we add the extra clean executions so that we remove any jars
added in the build to the deployDir or webAppDir
|
protected void |
updateDependencyPlugin(Element plugins,
Element dependencies,
Collection<io.fabric8.agent.mvn.Parser> artifacts)
Lets add/update the maven dependency plugin configuration to copy deployments
to the deployDir or the webAppDir
|
protected void |
updateRepositories(Element repositories,
List<io.fabric8.agent.mvn.MavenRepositoryURL> repos)
Ensure that the given maven repositories are added to the pom.xml
|
protected void |
updateWarPlugin(Element plugins)
We usually need to either comment out the WAR plugin or at least update its
destination file name
|
protected io.fabric8.common.util.XPathFacade |
xpath(String expression) |
public void update(Collection<io.fabric8.agent.mvn.Parser> artifacts, List<io.fabric8.agent.mvn.MavenRepositoryURL> repos) throws IOException, SAXException, ParserConfigurationException, XPathExpressionException, TransformerException, org.eclipse.jgit.api.errors.GitAPIException
IOException
SAXException
ParserConfigurationException
XPathExpressionException
TransformerException
org.eclipse.jgit.api.errors.GitAPIException
protected void updateWarPlugin(Element plugins) throws XPathExpressionException
XPathExpressionException
protected void updateCleanPlugin(Element plugins) throws XPathExpressionException
XPathExpressionException
protected void updateDependencyPlugin(Element plugins, Element dependencies, Collection<io.fabric8.agent.mvn.Parser> artifacts) throws XPathExpressionException
XPathExpressionException
protected void updateRepositories(Element repositories, List<io.fabric8.agent.mvn.MavenRepositoryURL> repos) throws XPathExpressionException
XPathExpressionException
protected void addRepositoryFlag(Element repository, String flagElementName, boolean flag)
protected Element getOrCreateOpenShiftProfilePlugins(Element project) throws XPathExpressionException
XPathExpressionException
protected Element recreateDependencyExecution(Element executions, Element dependencies, String executionId, String outputDir, List<io.fabric8.agent.mvn.Parser> list, boolean isWar) throws XPathExpressionException
XPathExpressionException
protected void addOrUpdateDependency(Element dependencies, io.fabric8.agent.mvn.Parser parser) throws XPathExpressionException
XPathExpressionException
protected void addMavenCoordinates(Element owner, io.fabric8.agent.mvn.Parser parser, int indent)
public static String groupId(io.fabric8.agent.mvn.Parser parser)
protected Element getOrCreatePlugin(Element plugins, String artifactId, String version) throws XPathExpressionException
XPathExpressionException
protected Element getPlugin(Element plugins, String artifactId) throws XPathExpressionException
XPathExpressionException
protected void detachElement(Element answer)
protected Element getOrCreateChild(Element owner, String elementName, int indent, boolean forceWhitespace) throws XPathExpressionException
XPathExpressionException
protected Element getOrCreateChild(Element owner, String elementName, int indent) throws XPathExpressionException
XPathExpressionException
public static Element createAndAppendChild(Element owner, String elementName, int indent, String text)
public static Element createAndAppendChild(Element owner, String elementName, int indent)
public static Element createAndAppendChild(Element owner, String elementName, int indent, boolean forceWhitespace)
protected io.fabric8.common.util.XPathFacade xpath(String expression) throws XPathExpressionException
XPathExpressionException
Copyright © 2011–2014 Red Hat. All rights reserved.