use of org.codehaus.plexus.util.xml.Xpp3Dom in project kie-wb-common by kiegroup.
the class MavenAPIUtil method disableMavenCompilerAlreadyPresent.
public static void disableMavenCompilerAlreadyPresent(Plugin plugin) {
Xpp3Dom skipMain = new Xpp3Dom(MavenConfig.MAVEN_SKIP_MAIN);
skipMain.setValue(TRUE);
Xpp3Dom skip = new Xpp3Dom(MavenConfig.MAVEN_SKIP);
skip.setValue(TRUE);
Xpp3Dom configuration = new Xpp3Dom(MavenConfig.MAVEN_PLUGIN_CONFIGURATION);
configuration.addChild(skipMain);
configuration.addChild(skip);
plugin.setConfiguration(configuration);
PluginExecution exec = new PluginExecution();
exec.setId(MavenConfig.MAVEN_DEFAULT_COMPILE);
exec.setPhase(MavenConfig.MAVEN_PHASE_NONE);
List<PluginExecution> executions = new ArrayList<>();
executions.add(exec);
plugin.setExecutions(executions);
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project kie-wb-common by kiegroup.
the class MavenAPIUtil method getNewCompilerPlugin.
public static Plugin getNewCompilerPlugin(Map<ConfigurationKey, String> conf) {
Plugin newCompilerPlugin = new Plugin();
newCompilerPlugin.setGroupId(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_GROUP));
newCompilerPlugin.setArtifactId(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_ARTIFACT));
newCompilerPlugin.setVersion(conf.get(ConfigurationKey.TAKARI_COMPILER_PLUGIN_VERSION));
Xpp3Dom compilerId = new Xpp3Dom(MavenConfig.MAVEN_COMPILER_ID);
compilerId.setValue(conf.get(ConfigurationKey.COMPILER));
Xpp3Dom sourceVersion = new Xpp3Dom(MavenConfig.MAVEN_SOURCE);
sourceVersion.setValue(conf.get(ConfigurationKey.SOURCE_VERSION));
Xpp3Dom targetVersion = new Xpp3Dom(MavenConfig.MAVEN_TARGET);
targetVersion.setValue(conf.get(ConfigurationKey.TARGET_VERSION));
Xpp3Dom failOnError = new Xpp3Dom(MavenConfig.FAIL_ON_ERROR);
failOnError.setValue(conf.get(ConfigurationKey.FAIL_ON_ERROR));
Xpp3Dom configuration = new Xpp3Dom(MavenConfig.MAVEN_PLUGIN_CONFIGURATION);
configuration.addChild(compilerId);
configuration.addChild(sourceVersion);
configuration.addChild(targetVersion);
configuration.addChild(failOnError);
newCompilerPlugin.setConfiguration(configuration);
PluginExecution execution = new PluginExecution();
execution.setId(MavenCLIArgs.DEFAULT_COMPILE);
execution.setGoals(Arrays.asList(MavenCLIArgs.COMPILE));
execution.setPhase(MavenCLIArgs.COMPILE);
newCompilerPlugin.setExecutions(Arrays.asList(execution));
return newCompilerPlugin;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project che by eclipse.
the class MavenModelUtil method convertXpp.
private static Element convertXpp(Xpp3Dom xpp3Dom) {
Element result;
try {
result = new Element(xpp3Dom.getName());
} catch (IllegalNameException e) {
return null;
}
Xpp3Dom[] children = xpp3Dom.getChildren();
if (children == null || children.length == 0) {
result.setText(xpp3Dom.getValue());
} else {
for (Xpp3Dom child : children) {
Element element = convertXpp(child);
if (element != null) {
result.addContent(element);
}
}
}
return result;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project jetty.project by eclipse.
the class WarPluginInfo method getMavenWarOverlayConfigs.
/**
* Get config for any overlays that have been declared for the maven-war-plugin.
*
* @return the list of overlay configs
*/
public List<OverlayConfig> getMavenWarOverlayConfigs() {
if (_overlayConfigs == null) {
getPlugin();
if (_plugin == null)
return Collections.emptyList();
getDependentMavenWarIncludes();
getDependentMavenWarExcludes();
Xpp3Dom node = (Xpp3Dom) _plugin.getConfiguration();
if (node == null)
return Collections.emptyList();
node = node.getChild("overlays");
if (node == null)
return Collections.emptyList();
Xpp3Dom[] nodes = node.getChildren("overlay");
if (nodes == null)
return Collections.emptyList();
_overlayConfigs = new ArrayList<OverlayConfig>();
for (int i = 0; i < nodes.length; i++) {
OverlayConfig overlayConfig = new OverlayConfig(nodes[i], _dependentMavenWarIncludes, _dependentMavenWarExcludes);
_overlayConfigs.add(overlayConfig);
}
}
return _overlayConfigs;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project jetty.project by eclipse.
the class WarPluginInfo method getMavenWarOverlayConfigAsString.
/**
* @return the xml as a string
*/
public String getMavenWarOverlayConfigAsString() {
getPlugin();
if (_plugin == null)
return "";
Xpp3Dom node = (Xpp3Dom) _plugin.getConfiguration();
if (node == null)
return "";
return node.toString();
}
Aggregations