use of org.codehaus.plexus.configuration.PlexusConfiguration in project liquibase by liquibase.
the class LiquibaseUpdateMojoTest method createUpdateMojo.
/*-------------------------------------------------------------------------*\
* PRIVATE METHODS
\*-------------------------------------------------------------------------*/
private LiquibaseUpdate createUpdateMojo() throws Exception {
LiquibaseUpdate mojo = new LiquibaseUpdate();
PlexusConfiguration config = loadConfiguration(CONFIG_FILE);
configureMojo(mojo, config);
return mojo;
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project sonatype-aether by sonatype.
the class PlexusWagonConfigurator method configure.
public void configure(Wagon wagon, Object configuration) throws Exception {
PlexusConfiguration config = null;
if (configuration instanceof PlexusConfiguration) {
config = (PlexusConfiguration) configuration;
} else if (configuration instanceof Xpp3Dom) {
config = new XmlPlexusConfiguration((Xpp3Dom) configuration);
} else if (configuration == null) {
return;
} else {
throw new IllegalArgumentException("Unexpected configuration type: " + configuration.getClass().getName());
}
WagonComponentConfigurator configurator = new WagonComponentConfigurator();
configurator.configureComponent(wagon, config, container.getContainerRealm());
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project maven-plugins by apache.
the class GenerateApplicationXmlMojo method buildEjbEntries.
/**
* Builds the ejb-ref based on the configuration.
*
* @return a list of EjbRef object(s)
* @throws EarPluginException if the configuration is invalid
*/
private List<EjbRef> buildEjbEntries() throws EarPluginException {
final List<EjbRef> result = new ArrayList<EjbRef>();
if (ejbRefs == null) {
return result;
}
try {
StringSearchInterpolator ssi = new StringSearchInterpolator();
ValueSource vs = new MapBasedValueSource(project.getProperties());
ssi.addValueSource(vs);
final PlexusConfiguration[] allEjbEntries = ejbRefs.getChildren(EjbRef.EJB_REF);
for (PlexusConfiguration ejbEntry : allEjbEntries) {
// CHECKSTYLE_OFF: LineLength
final String childDescription = interpolate(ssi, ejbEntry.getChild(EnvEntry.DESCRIPTION).getValue());
final String childEjbEntryName = interpolate(ssi, ejbEntry.getChild(EjbRef.EJB_NAME).getValue());
final String childEjbEntryType = interpolate(ssi, ejbEntry.getChild(EjbRef.EJB_TYPE).getValue());
final String childEjbLookupNameValue = interpolate(ssi, ejbEntry.getChild(EjbRef.EJB_LOOKUP_NAME).getValue());
try {
result.add(new EjbRef(childDescription, childEjbEntryName, childEjbEntryType, childEjbLookupNameValue));
} catch (IllegalArgumentException e) {
throw new EarPluginException("Invalid ejb-ref [" + ejbEntry + "]", e);
}
}
return result;
} catch (InterpolationException e) {
throw new EarPluginException("Interpolation exception:", e);
}
}
use of org.codehaus.plexus.configuration.PlexusConfiguration in project maven-plugins by apache.
the class ToolchainConverter method processConfiguration.
private void processConfiguration(ToolchainsRequirement requirement, PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator) throws ComponentConfigurationException {
Map<String, Map<String, String>> map = new HashMap<String, Map<String, String>>();
PlexusConfiguration[] tools = configuration.getChildren();
for (PlexusConfiguration tool : tools) {
String type = tool.getName();
PlexusConfiguration[] params = tool.getChildren();
Map<String, String> parameters = new HashMap<String, String>();
for (PlexusConfiguration param : params) {
parameters.put(param.getName(), param.getValue());
}
map.put(type, parameters);
}
requirement.toolchains = map;
}
Aggregations