use of org.codehaus.plexus.util.xml.Xpp3Dom in project fabric8-maven-plugin by fabric8io.
the class DockerServerUtil method getConfigurationValue.
private static String getConfigurationValue(final Server server, final String key) {
final Xpp3Dom configuration = (Xpp3Dom) server.getConfiguration();
if (configuration == null) {
return null;
}
final Xpp3Dom node = configuration.getChild(key);
if (node == null) {
return null;
}
return node.getValue();
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project fabric8-maven-plugin by fabric8io.
the class VertxPortsExtractor method getConfigPathFromProject.
@Override
public String getConfigPathFromProject(MavenProject project) {
Plugin plugin = project.getPlugin(Constants.VERTX_MAVEN_PLUGIN_GA);
if (plugin == null) {
return null;
}
Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
if (configuration == null) {
return null;
}
Xpp3Dom config = configuration.getChild("config");
return config != null ? config.getValue() : null;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project m2e-nar by maven-nar.
the class MavenUtils method getConfiguredMojo.
private static <T extends AbstractMojo> T getConfiguredMojo(MavenSession session, MojoExecution mojoExecution, Class<T> asType, Log log) throws CoreException {
MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor();
PluginDescriptor pluginDescriptor = mojoDescriptor.getPluginDescriptor();
ClassRealm pluginRealm = getMyRealm(pluginDescriptor.getClassRealm().getWorld());
T mojo;
try {
mojo = asType.newInstance();
} catch (Exception e) {
throw new CoreException(new Status(IStatus.ERROR, MavenNarPlugin.PLUGIN_ID, "Problem when creating mojo", e));
}
mojo.setLog(log);
logger.debug("Configuring mojo " + mojoDescriptor.getId() + " from plugin realm " + pluginRealm);
Xpp3Dom dom = mojoExecution.getConfiguration();
PlexusConfiguration pomConfiguration;
if (dom == null) {
pomConfiguration = new XmlPlexusConfiguration("configuration");
} else {
pomConfiguration = new XmlPlexusConfiguration(dom);
}
ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator(session, mojoExecution);
populatePluginFields(mojo, mojoDescriptor, pluginRealm, pomConfiguration, expressionEvaluator);
return mojo;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tycho by eclipse.
the class DefaultTargetPlatformConfigurationReaderTest method testExtraRequirementId.
@Test
public void testExtraRequirementId() throws Exception {
Xpp3Dom dom = createConfigurationDom("type", "versionRange");
try {
configurationReader.readExtraRequirements(new TargetPlatformConfiguration(), dom);
fail();
} catch (BuildFailureException e) {
assertTrue(e.getMessage().contains("Element <id> is missing in <extraRequirements><requirement> section."));
}
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project tycho by eclipse.
the class DefaultTargetPlatformConfigurationReaderTest method createGavConfiguration.
private Xpp3Dom createGavConfiguration(String groupId, String artifactId, String version) {
Xpp3Dom dom = new Xpp3Dom("artifact");
if (groupId != null) {
Xpp3Dom group = new Xpp3Dom("groupId");
group.setValue(groupId);
dom.addChild(group);
}
if (artifactId != null) {
Xpp3Dom artifact = new Xpp3Dom("artifactId");
artifact.setValue(artifactId);
dom.addChild(artifact);
}
if (version != null) {
Xpp3Dom ver = new Xpp3Dom("version");
ver.setValue(version);
dom.addChild(ver);
}
return dom;
}
Aggregations