Package org.apache.maven.model.io.xpp3

Examples of org.apache.maven.model.io.xpp3.MavenXpp3Writer


        Model pom = project.getModel();

        StringWriter sWriter = new StringWriter();

        MavenXpp3Writer pomWriter = new MavenXpp3Writer();

        try
        {
            pomWriter.write( sWriter, pom );

            message.append( "\n************************************************************************************" );
            message.append( "\nEffective POM for project \'" ).append( project.getId() ).append( "\'" );
            message.append( "\n************************************************************************************" );
            message.append( "\n" );
View Full Code Here


        {
            File tempFile = File.createTempFile( "mvndeploy", ".pom" );
            tempFile.deleteOnExit();

            fw = WriterFactory.newXmlWriter( tempFile );
            new MavenXpp3Writer().write( fw, model );

            return tempFile;
        }
        catch ( IOException e )
        {
View Full Code Here

                              boolean debugEnabled )
        throws ModelInterpolationException
    {
        StringWriter sWriter = new StringWriter( 1024 );

        MavenXpp3Writer writer = new MavenXpp3Writer();
        try
        {
            writer.write( sWriter, model );
        }
        catch ( IOException e )
        {
            throw new ModelInterpolationException( "Cannot serialize project model for interpolation.", e );
        }
View Full Code Here

     */
    @Deprecated
    public void writeModel( Writer writer )
        throws IOException
    {
        MavenXpp3Writer pomWriter = new MavenXpp3Writer();
        pomWriter.write( writer, getModel() );
    }
View Full Code Here

     */
    @Deprecated
    public void writeOriginalModel( Writer writer )
        throws IOException
    {
        MavenXpp3Writer pomWriter = new MavenXpp3Writer();
        pomWriter.write( writer, getOriginalModel() );
    }
View Full Code Here

                    translator.validateV4Basics( v4Model, v3Model.getGroupId(), v3Model.getArtifactId(),
                                                 v3Model.getVersion(), v3Model.getPackage() );

                    writer = new StringWriter();
                    MavenXpp3Writer xpp3Writer = new MavenXpp3Writer();
                    xpp3Writer.write( writer, v4Model );

                    transaction.createFile( writer.toString(), targetFile, digesters );

                    List<String> warnings = translator.getWarnings();
View Full Code Here

        Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$
        File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) );

        StringWriter strWriter = new StringWriter();
        MavenXpp3Writer pomWriter = new MavenXpp3Writer();
        pomWriter.write( strWriter, pom );

        transaction.createFile( strWriter.toString(), pomFile, digesters );
    }
View Full Code Here

            // TODO use WriterFactory.newXmlWriter() when plexus-utils is upgraded to 1.4.5+
            fw = new OutputStreamWriter(new FileOutputStream(pomFile), "UTF-8"); //$NON-NLS-1$
            model.setModelEncoding("UTF-8"); // to be removed when encoding is detected instead of forced to UTF-8 //$NON-NLS-1$
            pomFile.deleteOnExit();
            new MavenXpp3Writer().write(fw, model);
            metadata = new ProjectArtifactMetadata(pomArtifact, pomFile);
            pomArtifact.addMetadata(metadata);
        } catch (IOException e) {
            throw new MojoExecutionException(
                    Messages.getString(
View Full Code Here

                    translator.validateV4Basics( v4Model, v3Model.getGroupId(), v3Model.getArtifactId(), v3Model
                        .getVersion(), v3Model.getPackage() );

                    writer = new StringWriter();
                    MavenXpp3Writer Xpp3Writer = new MavenXpp3Writer();
                    Xpp3Writer.write( writer, v4Model );

                    transaction.createFile( writer.toString(), targetFile, digesters );

                    List warnings = translator.getWarnings();
View Full Code Here

        Artifact artifact = artifactFactory.createBuildArtifact( groupId, artifactId, version, "pom" ); //$NON-NLS-1$
        File pomFile = new File( repository.getBasedir(), repository.pathOf( artifact ) );

        StringWriter strWriter = new StringWriter();
        MavenXpp3Writer pomWriter = new MavenXpp3Writer();
        pomWriter.write( strWriter, pom );

        transaction.createFile( strWriter.toString(), pomFile, digesters );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.io.xpp3.MavenXpp3Writer

Copyright © 2018 www.massapicom. 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.