Examples of Xpp3Dom


Examples of org.codehaus.plexus.util.xml.Xpp3Dom

        return null;
    }

    public static Xpp3Dom convert( MojoDescriptor mojoDescriptor )
    {
        Xpp3Dom dom = new Xpp3Dom( "configuration" );

        PlexusConfiguration c = mojoDescriptor.getMojoConfiguration();

        PlexusConfiguration[] ces = c.getChildren();

        if ( ces != null )
        {
            for ( PlexusConfiguration ce : ces )
            {
                String value = ce.getValue( null );
                String defaultValue = ce.getAttribute( "default-value", null );
                if ( value != null || defaultValue != null )
                {
                    Xpp3Dom e = new Xpp3Dom( ce.getName() );
                    e.setValue( value );
                    if ( defaultValue != null )
                    {
                        e.setAttribute( "default-value", defaultValue );
                    }
                    dom.addChild( e );
                }
            }
        }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

        File pom = getProject( "project-with-additional-lifecycle-elements" );
        MavenSession session = createMavenSession( pom );
        MojoDescriptor mojoDescriptor =
            mojoDescriptorCreator.getMojoDescriptor( "org.apache.maven.its.plugins:maven-it-plugin:0.1:java", session,
                                                     session.getCurrentProject() );
        Xpp3Dom dom = MojoDescriptorCreator.convert( mojoDescriptor );
        System.out.println( dom );
    }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

        }
        return prjArtifact.getFile();
    }

    private static String nodeValue(final Xpp3Dom config, final String name, final String defaultValue) {
        final Xpp3Dom node = (config == null ? null : config.getChild(name));
        if (node != null) {
            return node.getValue();
        } else {
            return defaultValue;
        }
    }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

                }
            }
        }

        private void readConfiguration() throws IOException {
            Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
            defaultBundleList = null;
            jarWebSupport = null;
            includeDefaultBundles = true;
            bundleListFile = new File(project.getBasedir(), "src/main/bundles/list.xml");
            if (configuration != null) {
                includeDefaultBundles = nodeValue(configuration, "includeDefaultBundles", true);
                Xpp3Dom defaultBundleListConfig = configuration.getChild("defaultBundleList");
                if (defaultBundleListConfig != null) {
                    defaultBundleList = new ArtifactDefinition(defaultBundleListConfig);
                }
                Xpp3Dom jarWebSupportConfig = configuration.getChild("jarWebSupport");
                if (jarWebSupportConfig != null) {
                    jarWebSupport = new ArtifactDefinition(jarWebSupportConfig);
                }
                Xpp3Dom bundleListFileConfig = configuration.getChild("bundleListFile");
                if (bundleListFileConfig != null) {
                    bundleListFile = new File(project.getBasedir(), bundleListFileConfig.getValue());
                }

                configureAdditionalBundles(configuration);
            }

            for (PluginExecution execution : plugin.getExecutions()) {
                Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();
                if (executionConfiguration != null) {
                    configureAdditionalBundles(executionConfiguration);
                }
            }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

                }
            });
        }

        private void configureAdditionalBundles(Xpp3Dom configuration) {
            Xpp3Dom additionalBundlesConfig = configuration.getChild("additionalBundles");
            if (additionalBundlesConfig != null) {
                Xpp3Dom[] bundleConfigs = additionalBundlesConfig.getChildren("bundle");
                if (bundleConfigs != null) {
                    for (Xpp3Dom bundleConfig : bundleConfigs) {
                        additionalBundles.add(new ArtifactDefinition(bundleConfig));
                    }
                }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

            if (AbstractUsingBundleListMojo.JAR.equals(project.getPackaging())) {
                return true;
            } else {
                for (PluginExecution execution : plugin.getExecutions()) {
                    if (execution.getGoals().contains("prepare-package")) {
                        Xpp3Dom executionConfig = (Xpp3Dom) execution.getConfiguration();
                        if (executionConfig != null) {
                            Xpp3Dom packagingConfig = executionConfig.getChild("packaging");
                            if (packagingConfig != null
                                    && AbstractUsingBundleListMojo.JAR.equals(packagingConfig.getValue())) {
                                return true;
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

            fis.close();
        }
    }
   
    public static int nodeValue(Xpp3Dom config, String name, int defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return Integer.parseInt(node.getValue());
        } else {
            return defaultValue;
        }
    }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

            return defaultValue;
        }
    }
   
    public static boolean nodeValue(Xpp3Dom config, String name, boolean defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return Boolean.parseBoolean(node.getValue());
        } else {
            return defaultValue;
        }
    }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

            return defaultValue;
        }
    }

    public static String nodeValue(Xpp3Dom config, String name, String defaultValue) {
        Xpp3Dom node = config.getChild(name);
        if (node != null) {
            return node.getValue();
        } else {
            return defaultValue;
        }
    }
View Full Code Here

Examples of org.codehaus.plexus.util.xml.Xpp3Dom

    }


    private static PlexusConfiguration getPluginConfiguration( MavenProject project, String groupId, String artifactId )
    {
        Xpp3Dom pluginConfig = project.getGoalConfiguration( groupId, artifactId, null, null );

        return new XmlPlexusConfiguration( pluginConfig );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.