本文整理汇总了Java中org.codehaus.plexus.configuration.PlexusConfigurationException类的典型用法代码示例。如果您正苦于以下问题:Java PlexusConfigurationException类的具体用法?Java PlexusConfigurationException怎么用?Java PlexusConfigurationException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlexusConfigurationException类属于org.codehaus.plexus.configuration包,在下文中一共展示了PlexusConfigurationException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getConfiguration
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
/**
* @see HibernateMojo#getConfiguration()
*/
public PlexusConfiguration getConfiguration()
throws MojoExecutionException
{
try
{
// if it isn't the run goal, let's check that the goal exists
if ( !"run".equals( getGoalName() ) )
{
hibernatetool.getChild( getGoalName() );
}
return PlexusConfigurationUtils.parseHibernateTool( hibernatetool, getGoalName(), getAntClassLoader(),
session );
}
catch ( PlexusConfigurationException e )
{
throw new MojoExecutionException( "There was an error parsing the configuration", e );
}
}
开发者ID:frincon,项目名称:openeos,代码行数:22,代码来源:AbstractHibernateToolMojo.java
示例2: findComponents
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
@Override
public List<ComponentSetDescriptor> findComponents(Context context, ClassRealm classRealm)
throws PlexusConfigurationException {
AludraServiceRegistry registry = new AludraServiceRegistry();
configurator.configure(registry);
ComponentSetDescriptor descriptor = new ComponentSetDescriptor();
for (String roleName : registry.getRegisteredInterfaceNames()) {
String implClass = registry.getImplementationClassName(roleName);
if (implClass == null || implClass.trim().isEmpty()) {
throw new PlexusConfigurationException("Missing implementation class for interface " + roleName);
}
implClass = implClass.trim();
try {
Class<?> clazz = classRealm.loadClass(implClass);
descriptor.addComponentDescriptor(buildComponentDescriptor(classRealm.loadClass(roleName), clazz, classRealm));
}
catch (ClassNotFoundException e) {
throw new PlexusConfigurationException("Implementation class not found", e);
}
}
return Collections.singletonList(descriptor);
}
开发者ID:AludraTest,项目名称:aludratest,代码行数:26,代码来源:AludraTestComponentDiscoverer.java
示例3: toXppDom
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
/**
* Recursively convert PLEXUS config to Xpp3Dom.
* @param config The config to convert
* @return The Xpp3Dom document
* @see #execute(String,String,Properties)
*/
private Xpp3Dom toXppDom(final PlexusConfiguration config) {
final Xpp3Dom result = new Xpp3Dom(config.getName());
result.setValue(config.getValue(null));
for (final String name : config.getAttributeNames()) {
try {
result.setAttribute(name, config.getAttribute(name));
} catch (final PlexusConfigurationException ex) {
throw new IllegalArgumentException(ex);
}
}
for (final PlexusConfiguration child : config.getChildren()) {
result.addChild(this.toXppDom(child));
}
return result;
}
开发者ID:teamed,项目名称:qulice,代码行数:22,代码来源:MojoExecutor.java
示例4: fromConfiguration
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private JdkToolchain fromConfiguration( PlexusConfiguration configuration, ExpressionEvaluator expressionEvaluator )
throws ComponentConfigurationException
{
PlexusConfiguration[] params = configuration.getChildren();
Map parameters = new HashMap();
for ( int j = 0; j < params.length; j++ )
{
try
{
String name = params[j].getName();
String val = params[j].getValue();
parameters.put( name, val );
}
catch ( PlexusConfigurationException ex )
{
throw new ComponentConfigurationException( ex );
}
}
final JdkToolchain result = new JdkToolchain();
result.setParameters( Collections.unmodifiableMap( parameters ) );
return result;
}
开发者ID:gems-uff,项目名称:oceano,代码行数:23,代码来源:JdkToolchainConverter.java
示例5: getMojosAndGoals
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private void getMojosAndGoals(Model model, Plugin plugin) throws IOException, PlexusConfigurationException, Exception {
String version = plugin.getVersion();
if (version != null && version.startsWith("$")) {
version = model.getProperties().getProperty(plugin.getVersion().substring(2, plugin.getVersion().length() - 1));
plugin.setVersion(version);
}
Set<MojoDescriptor> mojoList = new HashSet<MojoDescriptor>();
try {
PluginDescriptor pluginDesc = ProjectModelCache.getInstance().getPluginDescriptor(plugin);
if (pluginDesc != null) {
for (Object exec : pluginDesc.getMojos()) {
MojoDescriptor mojoDesc = (MojoDescriptor) exec;
mojoList.add(mojoDesc);
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
config.addMojos(plugin.getKey(), mojoList);
}
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:21,代码来源:LaunchView.java
示例6: getPluginDescriptor
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public PluginDescriptor getPluginDescriptor(Plugin plugin) throws IOException, PlexusConfigurationException, Exception {
synchronized (cache) {
PluginDescriptor descriptor = (PluginDescriptor) cache.get(plugin.getKey());
if (descriptor == null) {
String version = plugin.getVersion();
VersionRange range = null;
if (version == null) {
version = "LATEST";
range = VersionRange.createFromVersionSpec(version);
} else {
range = VersionRange.createFromVersion(version);
}
DefaultArtifact pluginArtifact = new DefaultArtifact(plugin.getGroupId(), plugin.getArtifactId(), range, null, "jar", null, new DefaultArtifactHandler("jar"));
descriptor = MavenArtifactResolver.getInstance().getPluginDescriptor(pluginArtifact);
cache.put(plugin.getKey(), descriptor);
}
return descriptor;
}
}
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:21,代码来源:ProjectModelCache.java
示例7: createNow
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private Set<MavenProject> createNow(Settings settings, File pomFile) throws PlexusContainerException, PlexusConfigurationException, ComponentLookupException, MavenExecutionRequestPopulationException, ProjectBuildingException {
ContainerConfiguration containerConfiguration = new DefaultContainerConfiguration()
.setClassWorld(new ClassWorld("plexus.core", ClassWorld.class.getClassLoader()))
.setName("mavenCore");
DefaultPlexusContainer container = new DefaultPlexusContainer(containerConfiguration);
ProjectBuilder builder = container.lookup(ProjectBuilder.class);
MavenExecutionRequest executionRequest = new DefaultMavenExecutionRequest();
final Properties properties = new Properties();
properties.putAll(SystemProperties.getInstance().asMap());
executionRequest.setSystemProperties(properties);
MavenExecutionRequestPopulator populator = container.lookup(MavenExecutionRequestPopulator.class);
populator.populateFromSettings(executionRequest, settings);
populator.populateDefaults(executionRequest);
ProjectBuildingRequest buildingRequest = executionRequest.getProjectBuildingRequest();
buildingRequest.setProcessPlugins(false);
MavenProject mavenProject = builder.build(pomFile, buildingRequest).getProject();
Set<MavenProject> reactorProjects = new LinkedHashSet<MavenProject>();
//TODO adding the parent project first because the converter needs it this way ATM. This is oversimplified.
//the converter should not depend on the order of reactor projects.
//we should add coverage for nested multi-project builds with multiple parents.
reactorProjects.add(mavenProject);
List<ProjectBuildingResult> allProjects = builder.build(ImmutableList.of(pomFile), true, buildingRequest);
CollectionUtils.collect(allProjects, reactorProjects, new Transformer<MavenProject, ProjectBuildingResult>() {
public MavenProject transform(ProjectBuildingResult original) {
return original.getProject();
}
});
MavenExecutionResult result = new DefaultMavenExecutionResult();
result.setProject(mavenProject);
RepositorySystemSession repoSession = new DefaultRepositorySystemSession();
MavenSession session = new MavenSession(container, repoSession, executionRequest, result);
session.setCurrentProject(mavenProject);
return reactorProjects;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:39,代码来源:MavenProjectsCreator.java
示例8: parsePluginDetails
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private void parsePluginDetails(ArtifactInfo ai, ZipInputStream zis)
throws XmlPullParserException, IOException, PlexusConfigurationException {
PlexusConfiguration plexusConfig =
new XmlPlexusConfiguration(Xpp3DomBuilder.build(new InputStreamReader(zis, Charsets.UTF_8)));
ai.prefix = plexusConfig.getChild("goalPrefix").getValue();
ai.goals = new ArrayList<>();
PlexusConfiguration[] mojoConfigs = plexusConfig.getChild("mojos").getChildren("mojo");
for (PlexusConfiguration mojoConfig : mojoConfigs) {
ai.goals.add(mojoConfig.getChild("goal").getValue());
}
}
开发者ID:alancnet,项目名称:artifactory,代码行数:13,代码来源:VfsMavenPluginArtifactInfoIndexCreator.java
示例9: checkTargetName
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public String checkTargetName(PlexusConfiguration antTargetConfig)
throws PlexusConfigurationException {
String target_name = antTargetConfig.getAttribute("name");
if (target_name == null) {
target_name = DEFAULT_ANT_TARGET_NAME;
}
return target_name;
}
开发者ID:0xC70FF3,项目名称:java-gems,代码行数:9,代码来源:DebianMojo.java
示例10: parseHibernateTool
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public static PlexusConfiguration parseHibernateTool( PlexusConfiguration hibernatetool, String goalName,
ClassLoader classLoader, MavenSession session )
throws PlexusConfigurationException
{
// let's create the expression evaluator first
HibernateExpressionEvaluator evaluator = new HibernateExpressionEvaluator( session );
// now let's extract some basic information
PlexusConfiguration defaultConfiguration = findConfiguration( hibernatetool, evaluator );
List<PlexusConfiguration> goals = new Vector<PlexusConfiguration>();
List<PlexusConfiguration> properties = new Vector<PlexusConfiguration>();
for ( PlexusConfiguration child : hibernatetool.getChildren() )
{
if ( "goal".equals( PropertyUtils.getProperty( child.getName() ) ) )
{
goals.add( child );
}
else if ( !isConfiguration( child ) )
{
properties.add( child );
}
}
PlexusConfiguration target = getTarget( "hibernatetool", classLoader );
for ( PlexusConfiguration originalGoal : goals )
{
if ( "run".equals( goalName ) || originalGoal.getName().equals( goalName ) )
{
PlexusConfiguration task = getHibernateTask( hibernatetool, evaluator );
setDestinationDirectory( task, originalGoal, target, session, evaluator );
setHibernateConfiguration( task, originalGoal, defaultConfiguration, evaluator );
setHibernateGoal( task, originalGoal, evaluator );
setHibernateProperties( task, properties, evaluator );
target.addChild( task );
}
}
return target;
}
开发者ID:frincon,项目名称:openeos,代码行数:40,代码来源:PlexusConfigurationUtils.java
示例11: parseInstrument
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public static PlexusConfiguration parseInstrument( PlexusConfiguration instrument, ClassLoader classLoader,
MavenSession session )
throws PlexusConfigurationException
{
// let's create the expression evaluator first
HibernateExpressionEvaluator evaluator = new HibernateExpressionEvaluator( session );
// let's create the task now
PlexusConfiguration target = getTarget( "instrument", classLoader );
PlexusConfiguration task = getHibernateTask( instrument, evaluator );
target.addChild( copyChild( task.getName(), task, evaluator ) );
return target;
}
开发者ID:frincon,项目名称:openeos,代码行数:14,代码来源:PlexusConfigurationUtils.java
示例12: setDestinationDirectory
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private static void setDestinationDirectory( PlexusConfiguration task, PlexusConfiguration goal,
PlexusConfiguration target, MavenSession session,
HibernateExpressionEvaluator evaluator )
throws PlexusConfigurationException
{
// first let's find out where is the destination directory
String destdir = goal.getAttribute( "destdir" );
if ( destdir == null )
{
destdir = task.getAttribute( "destdir" );
}
if ( destdir == null )
{
destdir = PropertyUtils.getProperty( goal.getName() + ".destdir" );
}
destdir = evaluator.evaluateString( destdir );
// let's see it the destination directory needs to be added to sources
if ( "true".equals( PropertyUtils.getProperty( goal.getName() + ".addtosource" ) ) )
{
session.getCurrentProject().addCompileSourceRoot( destdir );
}
// create the directory
XmlPlexusConfiguration mkdir = new XmlPlexusConfiguration( "mkdir" );
mkdir.setAttribute( "dir", destdir );
target.addChild( mkdir );
// and add it to the task
( (XmlPlexusConfiguration) task ).setAttribute( "destdir", destdir );
}
开发者ID:frincon,项目名称:openeos,代码行数:32,代码来源:PlexusConfigurationUtils.java
示例13: setHibernateConfiguration
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private static void setHibernateConfiguration( PlexusConfiguration task, PlexusConfiguration originalGoal,
PlexusConfiguration defaultConfiguration,
HibernateExpressionEvaluator evaluator )
throws PlexusConfigurationException
{
PlexusConfiguration configuration = findConfiguration( originalGoal, evaluator );
if ( configuration == null )
{
configuration = defaultConfiguration;
}
task.addChild( configuration );
}
开发者ID:frincon,项目名称:openeos,代码行数:13,代码来源:PlexusConfigurationUtils.java
示例14: setHibernateProperties
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private static void setHibernateProperties( PlexusConfiguration task, List<PlexusConfiguration> properties,
HibernateExpressionEvaluator evaluator )
throws PlexusConfigurationException
{
for ( PlexusConfiguration property : properties )
{
task.addChild( copyChild( property.getName(), property, evaluator ) );
}
}
开发者ID:frincon,项目名称:openeos,代码行数:10,代码来源:PlexusConfigurationUtils.java
示例15: readMojos
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public static Collection<MojoDescriptor> readMojos(InputStream is) throws IOException, XmlPullParserException {
Reader reader = ReaderFactory.newXmlReader(is);
org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor;
try {
pluginDescriptor = new PluginDescriptorBuilder().build(reader);
} catch (PlexusConfigurationException e) {
Throwables.propagateIfPossible(e.getCause(), IOException.class, XmlPullParserException.class);
throw Throwables.propagate(e);
}
List<MojoDescriptor> result = new ArrayList<>();
for (org.apache.maven.plugin.descriptor.MojoDescriptor mojo : pluginDescriptor.getMojos()) {
result.add(toMojoDescriptor(mojo));
}
return result;
}
开发者ID:takari,项目名称:takari-lifecycle,代码行数:16,代码来源:LegacyPluginDescriptors.java
示例16: PluginContainerException
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public PluginContainerException( Plugin plugin, ClassRealm pluginRealm, String message,
PlexusConfigurationException e )
{
super( plugin, message, e );
this.pluginRealm = pluginRealm;
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:PluginContainerException.java
示例17: PluginManagerException
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public PluginManagerException( Plugin plugin, String message, PlexusConfigurationException cause )
{
super( message, cause );
pluginGroupId = plugin.getGroupId();
pluginArtifactId = plugin.getArtifactId();
pluginVersion = plugin.getVersion();
}
开发者ID:gems-uff,项目名称:oceano,代码行数:9,代码来源:PluginManagerException.java
示例18: build
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
private PluginDescriptor build( String resource )
throws IOException, PlexusConfigurationException
{
Reader reader = ReaderFactory.newXmlReader( getClass().getResourceAsStream( resource ) );
return new PluginDescriptorBuilder().build( reader );
}
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:PluginDescriptorBuilderTest.java
示例19: getPluginDescriptor
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
public PluginDescriptor getPluginDescriptor(File file) throws IOException, PlexusConfigurationException {
PluginDescriptor descriptor = null;
if (file.exists()) {
JarFile jarFile = new JarFile(file);
ZipEntry entry = jarFile.getEntry("META-INF/maven/plugin.xml");
InputStream plugin = jarFile.getInputStream(entry);
BufferedReader in = new BufferedReader(new InputStreamReader(plugin));
descriptor = new PluginDescriptorBuilder().build(in);
}
return descriptor;
}
开发者ID:mulesoft,项目名称:mule-tooling-incubator,代码行数:12,代码来源:MavenArtifactResolver.java
示例20: writeTargetToProjectFile
import org.codehaus.plexus.configuration.PlexusConfigurationException; //导入依赖的package包/类
/**
* Write the ant target and surrounding tags to a temporary file
*
* @throws PlexusConfigurationException
*/
private File writeTargetToProjectFile()
throws IOException, PlexusConfigurationException {
// Have to use an XML writer because in Maven 2.x the PlexusConfig toString() method loses XML attributes
StringWriter writer = new StringWriter();
AntrunXmlPlexusConfigurationWriter xmlWriter = new AntrunXmlPlexusConfigurationWriter();
xmlWriter.write(target, writer);
StringBuffer antProjectConfig = writer.getBuffer();
// replace deprecated tasks tag with standard Ant target
stringReplace(antProjectConfig, "<tasks", "<target");
stringReplace(antProjectConfig, "</tasks", "</target");
antTargetName = target.getAttribute("name");
if (antTargetName == null) {
antTargetName = DEFAULT_ANT_TARGET_NAME;
stringReplace(antProjectConfig, "<target", "<target name=\"" + antTargetName + "\"");
}
String xmlns = "";
if (!customTaskPrefix.trim().equals("")) {
xmlns = "xmlns:" + customTaskPrefix + "=\"" + TASK_URI + "\"";
}
final String xmlHeader = "<?xml version=\"1.0\" encoding=\"" + UTF_8 + "\" ?>\n";
antProjectConfig.insert(0, xmlHeader);
final String projectOpen = "<project name=\"maven-antrun-\" default=\"" + antTargetName + "\" " + xmlns + " >\n";
int index = antProjectConfig.indexOf("<target");
antProjectConfig.insert(index, projectOpen);
final String projectClose = "\n</project>";
antProjectConfig.append(projectClose);
// The fileName should probably use the plugin executionId instead of the targetName
String fileName = "build-" + antTargetName + ".xml";
File file = new File(project.getBuild().getDirectory(), "/antrun/" + fileName);
file.getParentFile().mkdirs();
FileUtils.fileWrite(file.getAbsolutePath(), UTF_8, antProjectConfig.toString());
return file;
}
开发者ID:0xC70FF3,项目名称:java-gems,代码行数:48,代码来源:DebianMojo.java
注:本文中的org.codehaus.plexus.configuration.PlexusConfigurationException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论