use of org.codehaus.plexus.util.xml.Xpp3Dom in project jetty.project by eclipse.
the class WarPluginInfo method getDependentMavenWarIncludes.
/**
* Get value of dependentWarIncludes for maven-war-plugin
* @return the list of dependent war includes
*/
public List<String> getDependentMavenWarIncludes() {
if (_dependentMavenWarIncludes == null) {
getPlugin();
if (_plugin == null)
return null;
Xpp3Dom node = (Xpp3Dom) _plugin.getConfiguration();
if (node == null)
return null;
node = node.getChild("dependentWarIncludes");
if (node == null)
return null;
String val = node.getValue();
_dependentMavenWarIncludes = StringUtil.csvSplit(null, val, 0, val.length());
}
return _dependentMavenWarIncludes;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project jetty.project by eclipse.
the class WarPluginInfo method getDependentMavenWarExcludes.
/**
* Get value of dependentWarExcludes for maven-war-plugin
* @return the list of dependent war excludes
*/
public List<String> getDependentMavenWarExcludes() {
if (_dependentMavenWarExcludes == null) {
getPlugin();
if (_plugin == null)
return null;
Xpp3Dom node = (Xpp3Dom) _plugin.getConfiguration();
if (node == null)
return null;
node = node.getChild("dependentWarExcludes");
if (node == null)
return null;
String val = node.getValue();
_dependentMavenWarExcludes = StringUtil.csvSplit(null, val, 0, val.length());
}
return _dependentMavenWarExcludes;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project intellij-community by JetBrains.
the class MavenModelConverter method xppToElement.
private static Element xppToElement(Xpp3Dom xpp) throws RemoteException {
Element result;
try {
result = new Element(xpp.getName());
} catch (IllegalNameException e) {
Maven3ServerGlobals.getLogger().info(e);
return null;
}
Xpp3Dom[] children = xpp.getChildren();
if (children == null || children.length == 0) {
result.setText(xpp.getValue());
} else {
for (Xpp3Dom each : children) {
Element child = xppToElement(each);
if (child != null)
result.addContent(child);
}
}
return result;
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project bnd by bndtools.
the class BndMavenPlugin method loadProjectProperties.
private File loadProjectProperties(Builder builder, MavenProject project) throws Exception {
// Load parent project properties first
MavenProject parentProject = project.getParent();
if (parentProject != null) {
loadProjectProperties(builder, parentProject);
}
// Merge in current project properties
Xpp3Dom configuration = project.getGoalConfiguration("biz.aQute.bnd", "bnd-maven-plugin", mojoExecution.getExecutionId(), mojoExecution.getGoal());
File baseDir = project.getBasedir();
if (baseDir != null) {
// file system based pom
File pomFile = project.getFile();
builder.updateModified(pomFile.lastModified(), "POM: " + pomFile);
// check for bnd file
String bndFileName = Project.BNDFILE;
if (configuration != null) {
Xpp3Dom bndfileElement = configuration.getChild("bndfile");
if (bndfileElement != null) {
bndFileName = bndfileElement.getValue();
}
}
File bndFile = IO.getFile(baseDir, bndFileName);
if (bndFile.isFile()) {
logger.debug("loading bnd properties from file: {}", bndFile);
// we use setProperties to handle -include
builder.setProperties(bndFile.getParentFile(), builder.loadProperties(bndFile));
return bndFile;
}
// no bnd file found, so we fall through
}
// check for bnd-in-pom configuration
if (configuration != null) {
Xpp3Dom bndElement = configuration.getChild("bnd");
if (bndElement != null) {
logger.debug("loading bnd properties from bnd element in pom: {}", project);
UTF8Properties properties = new UTF8Properties();
properties.load(bndElement.getValue(), project.getFile(), builder);
if (baseDir != null) {
String here = baseDir.toURI().getPath();
here = Matcher.quoteReplacement(here.substring(0, here.length() - 1));
properties = properties.replaceAll("\\$\\{\\.\\}", here);
}
// we use setProperties to handle -include
builder.setProperties(baseDir, properties);
}
}
return project.getFile();
}
use of org.codehaus.plexus.util.xml.Xpp3Dom in project sling by apache.
the class MavenBundlePluginProjectConfigurator method isSupportingM2eIncrementalBuild.
@Override
protected boolean isSupportingM2eIncrementalBuild(MavenProject mavenProject, Logger logger) {
Plugin bundlePlugin = mavenProject.getPlugin(MAVEN_BUNDLE_PLUGIN_KEY);
if (bundlePlugin == null) {
logger.warn("maven-bundle-plugin not configured!");
return false;
} else {
// check if m2elipse-tycho is already installed (which supports incremental builds for "bundle" packagings
if (LifecycleMappingFactory.createProjectConfigurator(M2E_TYCHO_EXTENSION_PROJECT_CONFIGURATOR_ID) != null) {
logger.trace("Project configurator with id '" + M2E_TYCHO_EXTENSION_PROJECT_CONFIGURATOR_ID + "' found -> m2e-tycho installed.");
return true;
}
String version = bundlePlugin.getVersion();
if (version == null) {
logger.warn("Could not retrieve used version of maven-bundle-plugin!");
return false;
}
ComparableVersion comparableVersion = new ComparableVersion(version);
// with https://issues.apache.org/jira/browse/FELIX-4009 m2e support for incremental builds was added to maven-bundle-plugin in version 3.2.0
if (comparableVersion.compareTo(new ComparableVersion("3.2.0")) >= 0) {
// therefore check configuration
for (PluginExecution pluginExecution : bundlePlugin.getExecutions()) {
if (!pluginExecution.getGoals().contains("manifest")) {
continue;
}
Xpp3Dom configuration = (Xpp3Dom) pluginExecution.getConfiguration();
Xpp3Dom supportIncrementalBuildConfiguration = configuration.getChild("supportIncrementalBuild");
// https://issues.apache.org/jira/browse/FELIX-3324
Xpp3Dom exportScrConfiguration = configuration.getChild("exportScr");
if (supportIncrementalBuildConfiguration == null || !Boolean.parseBoolean(supportIncrementalBuildConfiguration.getValue())) {
logger.warn("Although using maven-bundle-plugin in a version >= 3.2.0, the incremental build support was not enabled.");
} else if (exportScrConfiguration == null || !Boolean.parseBoolean(exportScrConfiguration.getValue())) {
logger.warn("Although using maven-bundle-plugin in a version >= 3.2.0 with incremental build support enabled, component descriptors are not exported (exportScr=false) .");
} else {
logger.trace("Using maven-bundle-plugin in a version >= 3.2.0 with the incremental build support correctly enabled.");
return true;
}
}
} else {
logger.warn("maven-bundle-plugin in a version < 3.2.0 does not natively support incremental builds.");
}
}
return false;
}
Aggregations