Java 类org.apache.maven.model.io.xpp3.MavenXpp3Writer 实例源码

项目:gradle-maven-sync-plugin    文件:GradleStepdefs.java   
@And("^POM file with dependencies:$")
public void pomFileWithDependencies(List<MavenDependencySpec> dependencies) throws Throwable {
  for (MavenDependencySpec dependency : dependencies) {
    dependency.setExcludes(dependency.excludes);
  }

  Model model = new Model();
  model.setModelVersion("4.0.0");
  model.setGroupId("com.example");
  model.setArtifactId("example-artifact");
  model.setVersion("1.0.0-SNAPSHOT");
  model.setPackaging("pom");
  dependencies.forEach(model::addDependency);

  Path pomFile = projectDir.resolve("pom.xml");
  new MavenXpp3Writer().write(Files.newBufferedWriter(pomFile), model);
}
项目:IodineToolkit    文件:POMData.java   
public POMData(ParentData parentData, String groupId, String artifactId, String versionId,
               List<DependencyData>
        dependencies, List<RepositoryData> repositories) throws IOException {
    Model model = new Model();
    parentData.write(model);
    model.setGroupId(groupId);
    model.setArtifactId(artifactId);
    model.setVersion(versionId);
    model.setModelVersion("4.0.0");
    dependencies.forEach((dependencyData -> dependencyData.write(model)));
    repositories.forEach((repositoryData -> repositoryData.write(model)));
    this.dependencies = dependencies;
    this.repositories = repositories;
    this.groupId = groupId;
    this.artifactId = artifactId;
    this.version = versionId;
    StringWriter writer = new StringWriter();
    new MavenXpp3Writer().write(writer, model);
    this.xml = writer.toString();
}
项目:apache-archiva    文件:DefaultFileUploadService.java   
private File createPom( File targetPath, String filename, FileMetadata fileMetadata, String groupId,
                        String artifactId, String version, String packaging )
    throws IOException
{
    Model projectModel = new Model();
    projectModel.setModelVersion( "4.0.0" );
    projectModel.setGroupId( groupId );
    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;
}
项目:rug-resolver    文件:ManifestPomWriter.java   
public String write(Manifest manifest, ArtifactDescriptor artifact) {
    MavenXpp3Writer writer = new MavenXpp3Writer();
    Model model = new Model();

    addProjectInformation(manifest, artifact, model);
    addRequiresDependency(manifest, model);
    addArchiveDependencies(manifest, model);
    addBinaryDependencies(manifest, model);
    addRepositories(manifest, model);

    StringWriter sw = new StringWriter();
    try {
        writer.write(sw, model);
    }
    catch (IOException e) {
    }
    return sw.toString();
}
项目:cloudkeeper    文件:DummyAetherRepository.java   
private static void generatePOM(Path pomFile, String groupId, String artifactId, List<String> dependencies)
        throws IOException {
    Model pom = new Model();
    pom.setModelVersion(MODEL_VERSION);

    pom.setGroupId(groupId);
    pom.setArtifactId(artifactId);
    pom.setVersion(VERSION.toString());
    pom.setPackaging("jar");
    pom.setName(artifactId + ": fabricated POM for testing");

    for (String dependency: dependencies) {
        pom.addDependency(createMavenDependency(dependency, TYPE));
        pom.addDependency(createMavenDependency(dependency, "jar"));
    }

    MavenXpp3Writer writer = new MavenXpp3Writer();
    try (OutputStream outputStream = Files.newOutputStream(pomFile)) {
        writer.write(outputStream, pom);
    }
}
项目:DICE-Platform    文件:QualityTestingNewProjectWizard.java   
/**
 * Add the Maven dependency to the new created project
 */
private void addDependency(Model model, IMavenProjectFacade facade) {
    String latestVersion = getLatestVersion();

    Dependency dependency = new Dependency();
    dependency.setGroupId(groupId);
    dependency.setArtifactId(artifactId);
    dependency.setVersion(latestVersion);

    model.addDependency(dependency);

    try {
        FileOutputStream fos = new FileOutputStream(facade.getPomFile());
        new MavenXpp3Writer().write(fos, model);
    } catch (IOException e) {
    }
}
项目:intellij-ce-playground    文件:MavenEffectivePomDumper.java   
/**
 * org.apache.maven.plugins.help.EffectivePomMojo#writeEffectivePom
 */
private static void writeEffectivePom(MavenProject project, XMLWriter writer)
  throws MojoExecutionException {
  Model pom = project.getModel();
  cleanModel(pom);

  String effectivePom;

  StringWriter sWriter = new StringWriter();
  MavenXpp3Writer pomWriter = new MavenXpp3Writer();
  try {
    pomWriter.write(sWriter, pom);
  }
  catch (IOException e) {
    throw new MojoExecutionException("Cannot serialize POM to XML.", e);
  }

  effectivePom = addMavenNamespace(sWriter.toString(), true);

  writeComment(writer, "Effective POM for project \'" + project.getId() + "\'");

  writer.writeMarkup(effectivePom);
}
项目:utils4maven    文件:MavenPomReaderTest.java   
@Test
public void testReadModel() throws IOException {

    // PREPARE
    final String expected = IOUtils.toString(getClass()
            .getResourceAsStream("/objects4j.xml"), Charset.forName("ISO-8859-1"));

    // TEST
    final Model model = MavenPomReader
            .readModel("org.fuin:objects4j:0.6.1");

    // VERIFY
    final MavenXpp3Writer writer = new MavenXpp3Writer();
    final StringWriter sw = new StringWriter();
    writer.write(sw, model);
    assertThat(sw.toString()).isEqualTo(expected);
    assertThat(model.getName()).isEqualTo("Objects4J");
    assertThat(model.getScm()).isNotNull();
    assertThat(model.getScm().getUrl()).isEqualTo("https://github.com/fuinorg/objects4j/");



}
项目:che    文件:EffectivePomWriter.java   
/**
 * method from org.apache.maven.plugins.help.EffectivePomMojo Method for writing the effective pom
 * informations of the current build.
 *
 * @param project the project of the current build, not null.
 * @param writer the XML writer , not null, not null.
 * @throws MojoExecutionException if any
 */
private static void writeEffectivePom(MavenProject project, XMLWriter writer)
    throws MojoExecutionException {
  Model pom = project.getModel();
  cleanModel(pom);

  String effectivePom;

  StringWriter sWriter = new StringWriter();
  MavenXpp3Writer pomWriter = new MavenXpp3Writer();
  try {
    pomWriter.write(sWriter, pom);
  } catch (IOException e) {
    throw new MojoExecutionException("Cannot serialize POM to XML.", e);
  }

  effectivePom = addMavenNamespace(sWriter.toString(), true);

  writeComment(writer, "Effective POM for project \'" + project.getId() + "\'");

  writer.writeMarkup(effectivePom);
}
项目:appformer    文件:GuvnorM2Repository.java   
public String generatePOM(final GAV gav) {
    Model model = new Model();
    model.setGroupId(gav.getGroupId());
    model.setArtifactId(gav.getArtifactId());
    model.setVersion(gav.getVersion());
    model.setModelVersion("4.0.0");

    StringWriter stringWriter = new StringWriter();
    try {
        new MavenXpp3Writer().write(stringWriter,
                                    model);
    } catch (IOException e) {
        log.error(e.getMessage());
    }

    return stringWriter.toString();
}
项目:appformer    文件:GuvnorM2Repository.java   
public String generateParentPOM(final GAV gav) {
    Model model = new Model();
    model.setGroupId(gav.getGroupId());
    model.setArtifactId(gav.getArtifactId());
    model.setVersion(gav.getVersion());
    model.setPackaging("pom");
    model.setModelVersion("4.0.0");

    StringWriter stringWriter = new StringWriter();
    try {
        new MavenXpp3Writer().write(stringWriter,
                                    model);
    } catch (IOException e) {
        log.error(e.getMessage());
    }

    return stringWriter.toString();
}
项目:appformer    文件:POMContentHandler.java   
private String toString(final POM pom,
                        final Model model) throws IOException {
    model.setName(pom.getName());
    model.setDescription(pom.getDescription());
    model.setArtifactId(pom.getGav().getArtifactId());
    model.setModelVersion(pom.getModelVersion());

    model.setGroupId(pom.getGav().getGroupId());
    model.setVersion(pom.getGav().getVersion());

    model.setPackaging(pom.getPackaging());

    model.setParent(getParent(pom));
    model.setBuild(getBuild(pom,
                            model));
    model.setModules(getModules(pom));
    model.setRepositories(getRepositories(pom));
    new DependencyUpdater(model.getDependencies()).updateDependencies(pom.getDependencies());

    StringWriter stringWriter = new StringWriter();
    new MavenXpp3Writer().write(stringWriter,
                                model);
    return stringWriter.toString();
}
项目:tools-idea    文件:MavenEffectivePomDumper.java   
/**
 * org.apache.maven.plugins.help.EffectivePomMojo#writeEffectivePom
 */
private static void writeEffectivePom(MavenProject project, XMLWriter writer)
  throws MojoExecutionException {
  Model pom = project.getModel();
  cleanModel(pom);

  String effectivePom;

  StringWriter sWriter = new StringWriter();
  MavenXpp3Writer pomWriter = new MavenXpp3Writer();
  try {
    pomWriter.write(sWriter, pom);
  }
  catch (IOException e) {
    throw new MojoExecutionException("Cannot serialize POM to XML.", e);
  }

  effectivePom = addMavenNamespace(sWriter.toString(), true);

  writeComment(writer, "Effective POM for project \'" + project.getId() + "\'");

  writer.writeMarkup(effectivePom);
}
项目:archiva    文件:DefaultFileUploadService.java   
private Path createPom( Path targetPath, String filename, FileMetadata fileMetadata, String groupId,
                        String artifactId, String version, String packaging )
    throws IOException
{
    Model projectModel = new Model();
    projectModel.setModelVersion( "4.0.0" );
    projectModel.setGroupId( groupId );
    projectModel.setArtifactId( artifactId );
    projectModel.setVersion( version );
    projectModel.setPackaging( packaging );

    Path pomFile = targetPath.resolve( filename );
    MavenXpp3Writer writer = new MavenXpp3Writer();

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

    return pomFile;
}
项目:minnal    文件:PomGenerator.java   
@Override
public void generate() {
    logger.info("Creating the pom file {}", POM_FILE);
    File pom = new File(baseDir, POM_FILE);
    OutputStreamWriter fileWriter = null;
    try {
        fileWriter = new OutputStreamWriter(new FileOutputStream(pom), Charsets.UTF_8);
        logger.debug("Writing the generated pom file {}", POM_FILE);
        MavenXpp3Writer writer = new MavenXpp3Writer();
        writer.write(fileWriter, model);
    } catch (Exception e) {
        throw new MinnalGeneratorException("Failed while writing the pom - " + pom.getName(), e);
    } finally {
        closeStream(fileWriter);
    }
}
项目:oceano    文件:DefaultModelWriter.java   
public void write( Writer output, Map<String, Object> options, Model model )
    throws IOException
{
    if ( output == null )
    {
        throw new IllegalArgumentException( "output writer missing" );
    }

    if ( model == null )
    {
        throw new IllegalArgumentException( "model missing" );
    }

    try
    {
        MavenXpp3Writer w = new MavenXpp3Writer();
        w.write( output, model );
    }
    finally
    {
        IOUtil.close( output );
    }
}
项目:SpecialSourceMP    文件:InstallRemappedFileMojo.java   
/**
 * Generates a (temporary) POM file from the plugin configuration. It's the responsibility of the caller to delete
 * the generated file when no longer needed.
 *
 * @return The path to the generated POM file, never <code>null</code>.
 * @throws MojoExecutionException If the POM file could not be generated.
 */
private File generatePomFile()
        throws MojoExecutionException
{
    Model model = generateModel();

    Writer writer = null;
    try
    {
        File pomFile = File.createTempFile( "mvninstall", ".pom" );

        writer = WriterFactory.newXmlWriter(pomFile);
        new MavenXpp3Writer().write( writer, model );

        return pomFile;
    }
    catch ( IOException e )
    {
        throw new MojoExecutionException( "Error writing temporary POM file: " + e.getMessage(), e );
    }
    finally
    {
        IOUtil.close(writer);
    }
}
项目:Reer    文件:DefaultMavenPom.java   
private void writeNonEffectivePom(final Writer pomWriter) throws IOException {
    try {
        withXmlActions.transform(pomWriter, POM_FILE_ENCODING, new ErroringAction<Writer>() {
            protected void doExecute(Writer writer) throws IOException {
                new MavenXpp3Writer().write(writer, getModel());
            }
        });
    } finally {
        pomWriter.close();
    }
}
项目:Reer    文件:MavenPomFileGenerator.java   
public MavenPomFileGenerator writeTo(File file) {
    xmlTransformer.transform(file, POM_FILE_ENCODING, new Action<Writer>() {
        public void execute(Writer writer) {
            try {
                new MavenXpp3Writer().write(writer, model);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }
    });
    return this;
}
项目:Reer    文件:MavenProjectXmlWriter.java   
private String toXml(MavenProject project) {
    StreamByteBuffer out = new StreamByteBuffer();
    try {
        new MavenXpp3Writer().write(out.getOutputStream(), project.getModel());
    } catch (IOException e) {
        throw new RuntimeException("Unable to serialize Maven model to XML. Maven project: " + project, e);
    }
    return prepareXml(out.readAsString());
}
项目:smart-testing    文件:BuildConfigurator.java   
public BuildConfigurator useSurefireVersion(String version) {
    File pomFile = new File(projectBuilder.getRoot().toAbsolutePath().toString()+ File.separator + "pom.xml");
    try {
        Model model = new MavenXpp3Reader().read(new FileInputStream(pomFile));
        model.getProperties().setProperty("version.surefire.plugin", version);
        new MavenXpp3Writer().write(new FileOutputStream(pomFile), model);
    } catch (IOException | XmlPullParserException e) {
        throw new RuntimeException("Failed setting surefire version in pom.", e);
    }
    return this;
}
项目:smart-testing    文件:ModifiedPomExporter.java   
static void exportModifiedPom(Model model) {
    try (StringWriter pomOut = new StringWriter()) {
        new MavenXpp3Writer().write(pomOut, model);
        writeModifiedPomToTarget(pomOut, model.getProjectDirectory());
    } catch (IOException e) {
        throw new RuntimeException("Failed writing updated pom file: " + model.getPomFile().getAbsolutePath(), e);
    }
}
项目:IodineToolkit    文件:POMData.java   
public POMData(ParentData parentData, String artifactId, List<DependencyData> dependencies,
               List<RepositoryData> repositories) throws IOException {
    Model model = new Model();
    parentData.write(model);
    model.setArtifactId(artifactId);
    model.setModelVersion("4.0.0");
    dependencies.forEach((dependencyData -> dependencyData.write(model)));
    repositories.forEach((repositoryData -> repositoryData.write(model)));
    this.dependencies = dependencies;
    this.repositories = repositories;
    this.artifactId = artifactId;
    StringWriter stringWriter = new StringWriter();
    new MavenXpp3Writer().write(stringWriter, model);
    this.xml = stringWriter.toString();
}
项目:apache-archiva    文件:LegacyToDefaultConverter.java   
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId,
                                 String newArtifactId, String newVersion, String message,
                                 ArtifactRepository repository, FileTransaction transaction )
    throws IOException
{
    Model pom = new Model();
    pom.setGroupId( groupId );
    pom.setArtifactId( artifactId );
    pom.setVersion( version );

    DistributionManagement dMngt = new DistributionManagement();

    Relocation relocation = new Relocation();
    relocation.setGroupId( newGroupId );
    relocation.setArtifactId( newArtifactId );
    relocation.setVersion( newVersion );
    if ( message != null && message.length() > 0 )
    {
        relocation.setMessage( message );
    }

    dMngt.setRelocation( relocation );

    pom.setDistributionManagement( dMngt );

    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 );
}
项目:mvn-golang    文件:GolangMvnInstallMojo.java   
private void saveEffectivePom(@Nonnull final File folder) throws IOException {
    final Model model = this.project.getModel();
    Writer writer = null;
    try {
        writer = new OutputStreamWriter(new FileOutputStream(new File(folder, "pom.xml"), false), "UTF-8");
        new MavenXpp3Writer().write(writer, model);
        if (getLog().isDebugEnabled()) {
            getLog().debug("Effective pom has been written");
        }
    } finally {
        closeSilently(writer);
    }
}
项目:xmvn    文件:ModelProcessorTest.java   
private String m2s( Model m )
    throws Exception
{
    StringWriter sw = new StringWriter();
    new MavenXpp3Writer().write( sw, m );
    return sw.toString();
}
项目:tibco-bwmaven    文件:POMManager.java   
/**
 * Write a Maven {@link Model} object to a POM file.
 * 
 * @param model
 * @param pom
 * @param logger
 * @throws IOException
 */
public static void writeModelToPOM(Model model, File pom, Log logger) throws IOException {
    FileOutputStream fos = new FileOutputStream(pom);

    new MavenXpp3Writer().write(fos, model);

    try {
        fos.close();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
项目:packagedrone    文件:Pom.java   
public void writePom ( final Writer writer ) throws IOException
{
    final Model model = new Model ();
    model.setGroupId ( this.groupId );
    model.setArtifactId ( this.artifactId );
    model.setVersion ( this.version );

    new MavenXpp3Writer ().write ( writer, model );
}
项目:multi-module-maven-release-plugin    文件:PomUpdater.java   
public UpdateResult updateVersion() {
    List<File> changedPoms = new ArrayList<File>();
    List<String> errors = new ArrayList<String>();
    for (ReleasableModule module : reactor.getModulesInBuildOrder()) {
        try {
            MavenProject project = module.getProject();
            if (module.willBeReleased()) {
                log.info("Going to release " + module.getArtifactId() + " " + module.getNewVersion());
            }

            List<String> errorsForCurrentPom = alterModel(project, module.getNewVersion());
            errors.addAll(errorsForCurrentPom);

            File pom = project.getFile().getCanonicalFile();
            changedPoms.add(pom);
            Writer fileWriter = WriterFactory.newXmlWriter(pom);

            Model originalModel = project.getOriginalModel();
            try {
                MavenXpp3Writer pomWriter = new MavenXpp3Writer();
                pomWriter.write(fileWriter, originalModel);
            } finally {
                fileWriter.close();
            }
        } catch (Exception e) {
            return new UpdateResult(changedPoms, errors, e);
        }
    }
    return new UpdateResult(changedPoms, errors, null);
}
项目:ogham    文件:AddMavenDependency.java   
private void write(Project project, Model model) throws AddDependencyException {
    try {
        MavenXpp3Writer writer = new MavenXpp3Writer();
        writer.write(new FileWriter(project.getPath().resolve("pom.xml").toFile()), model);
    } catch(IOException e) {
        throw new AddDependencyException("Failed to write pom.xml", e);
    }
}
项目:uber-pom    文件:UPomModel.java   
public String asXML(final Log log, final boolean removeDuplicatedSiblings) throws Exception {
  final MavenXpp3Writer mavenWritter = new MavenXpp3Writer();
  final StringWriter buffer = new StringWriter(16384);
  mavenWritter.write(buffer, this.model);
  String result = buffer.toString();
  if (removeDuplicatedSiblings) {
    if (log != null) {
      log.warn("Activated search and removing of duplicated sibling elements!");
    }
    result = findAndRemoveDuplicatedSiblings(log, result);
  } else if (log != null) {
    log.info("Search and removing of duplicated sibling elements is OFF");
  }
  return result;
}
项目:artifactory    文件:MavenModelUtils.java   
public static String mavenModelToString(Model model) {
    MavenXpp3Writer writer = new MavenXpp3Writer();
    StringWriter stringWriter = new StringWriter();
    try {
        writer.write(stringWriter, model);
    } catch (IOException e) {
        throw new RepositoryRuntimeException("Failed to convert maven model to string", e);
    }
    return stringWriter.toString();
}
项目:developer-studio    文件:MavenUtils.java   
public static void saveMavenProject(MavenProject project, File file) throws IOException {
    if (file.getParentFile()!=null){
        file.getParentFile().mkdirs();
    }
    MavenXpp3Writer mavenXpp3writer = new MavenXpp3Writer();
    FileWriter fileWriter = new FileWriter(file);
    mavenXpp3writer.write(fileWriter, project.getModel());
    fileWriter.close();
}
项目:package-drone    文件:Pom.java   
public void writePom ( final Writer writer ) throws IOException
{
    final Model model = new Model ();
    model.setGroupId ( this.groupId );
    model.setArtifactId ( this.artifactId );
    model.setVersion ( this.version );

    new MavenXpp3Writer ().write ( writer, model );
}
项目:mirah-nbm    文件:Utilities.java   
public static void performPOMModelOperations(FileObject pom, List<ModelOperation> operations) throws XmlPullParserException, IOException{
    InputStream is = null;
    Model model = null;
    MavenXpp3Reader reader = new MavenXpp3Reader();
    try {
        is = pom.getInputStream();
        model = reader.read(is);
    } finally {
        try {
            if ( is != null ){
                is.close();
            }
        } catch ( Throwable t){}
    }

    if ( model == null ){
        throw new IOException("Failed to read model.");
    }
    for ( ModelOperation o : operations ){
        o.performOperation(model);
    }
    OutputStream os = null;
    MavenXpp3Writer writer = new MavenXpp3Writer();

    try {
        os = pom.getOutputStream();
        writer.write(os, model);
    } finally {
        try {
            if ( os != null ){
                os.close();
            }
        } catch ( Exception ex){}
    }



}
项目:archiva    文件:LegacyToDefaultConverter.java   
private void writeRelocationPom( String groupId, String artifactId, String version, String newGroupId,
                                 String newArtifactId, String newVersion, String message,
                                 ArtifactRepository repository, FileTransaction transaction )
    throws IOException
{
    Model pom = new Model();
    pom.setGroupId( groupId );
    pom.setArtifactId( artifactId );
    pom.setVersion( version );

    DistributionManagement dMngt = new DistributionManagement();

    Relocation relocation = new Relocation();
    relocation.setGroupId( newGroupId );
    relocation.setArtifactId( newArtifactId );
    relocation.setVersion( newVersion );
    if ( message != null && message.length() > 0 )
    {
        relocation.setMessage( message );
    }

    dMngt.setRelocation( relocation );

    pom.setDistributionManagement( dMngt );

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

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

    transaction.createFile( strWriter.toString(), pomFile, digesters );
}
项目:pom-manipulation-ext    文件:PomIO.java   
/**
 * Writes out the Model to the selected target file.
 *
 * @param model the Model to write out.
 * @param target the file to write to.
 * @throws ManipulationException if an error occurs.
 */
public void writeModel( final Model model, final File target)
                throws ManipulationException
{
    try
    {
        new MavenXpp3Writer().write( new FileWriter( target ), model );
    }
    catch ( IOException e )
    {
        throw new ManipulationException( "Unable to write file", e );
    }
}
项目:oceano    文件:MavenProject.java   
/**
 * @deprecated Use {@link org.apache.maven.model.io.ModelWriter}.
 */
@Deprecated
public void writeModel( Writer writer )
    throws IOException
{
    MavenXpp3Writer pomWriter = new MavenXpp3Writer();
    pomWriter.write( writer, getModel() );
}
项目:oceano    文件:MavenProject.java   
/**
 * @deprecated Use {@link org.apache.maven.model.io.ModelWriter}.
 */
@Deprecated
public void writeOriginalModel( Writer writer )
    throws IOException
{
    MavenXpp3Writer pomWriter = new MavenXpp3Writer();
    pomWriter.write( writer, getOriginalModel() );
}
项目:kie-wb-common    文件:DefaultPomEditor.java   
public DefaultPomEditor(Set<PomPlaceHolder> history,
                        ConfigurationProvider config,
                        Compilers compiler) {
    conf = config.loadConfiguration();
    reader = new MavenXpp3Reader();
    writer = new MavenXpp3Writer();
    this.history = history;
    this.compiler = compiler;
}