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

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


     */
    @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

        projectModel.setArtifactId( artifactId );
        projectModel.setVersion( version );
        projectModel.setPackaging( packaging );

        File pomFile = new File( targetPath, filename );
        MavenXpp3Writer writer = new MavenXpp3Writer();

        try (FileWriter w = new FileWriter( pomFile ))
        {
            writer.write( w, projectModel );
        }

        return pomFile;
    }
View Full Code Here

        {
            sendWarnMessage( "pom.xml in " + outputdir.getAbsolutePath() + " already exists, overwriting" );
            alreadyExist = true;
        }

        MavenXpp3Writer v4Writer = new MavenXpp3Writer();

        // write the new pom.xml
        sendInfoMessage( "Writing new pom to: " + pomxml.getAbsolutePath() );

        Writer output = null;
        try
        {
            output = new FileWriter( pomxml );
            v4Writer.write( output, v4Model );
            output.close();
            fireSavePomEvent( pomxml, alreadyExist );
        }
        catch ( IOException e )
        {
View Full Code Here

        {
            translator.validateV4Basics( model, groupId, artifactId, version, packaging );

            if ( !reportOnly )
            {
                MavenXpp3Writer writer = new MavenXpp3Writer();
                writer.write( to, model );
            }
        }
    }
View Full Code Here

        {
            translator.validateV4Basics( v4Model, groupId, artifactId, version, packaging );

            if ( !reportOnly )
            {
                MavenXpp3Writer v4Writer = new MavenXpp3Writer();
                v4Writer.write( to, v4Model );
            }
        }
    }
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 )
        {
View Full Code Here

    return model;
  }
 
  private void writePom(File pom, Model model) throws IOException {
    Writer writer = WriterFactory.newXmlWriter(pom);
    new MavenXpp3Writer().write(writer, model);
    writer.close();
  }
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 )
        {
View Full Code Here

        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

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.