@Test public void testWriteModel() throws Exception { String sb = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xsi:schemaLocation=\"http: + " xmlns:xsi=\"http: + " <modelVersion>4.0.0</modelVersion>\n" + " <groupId>org.commonjava.maven.ext.versioning.test</groupId>\n" + " <artifactId>dospom</artifactId>\n" + " <version>1.0</version>\n" + " <packaging>pom</packaging>\n" + "</project>\n"; URL resource = PomIOTest.class.getResource( filename ); assertNotNull( resource ); File pom = new File( resource.getFile() ); assertTrue( pom.exists() ); File targetFile = folder.newFile( "target.xml" ); Model model = new Model(); model.setGroupId( "org.commonjava.maven.ext.versioning.test" ); model.setArtifactId( "dospom" ); model.setVersion( "1.0" ); model.setPackaging( "pom" ); model.setModelVersion( "4.0.0" ); pomIO.writeModel( model, targetFile ); assertTrue( targetFile.exists() ); assertEquals( sb, FileUtils.readFileToString( targetFile, StandardCharsets.UTF_8 ) ); }
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 ); } }
PomIO { 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 ); } } }
PomIO { 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 ); } }  }
PomIO { 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 ); } }  List<Project> parseProject( final File pom ); ProjectVersionRef rewritePOMs( final Set<Project> changed ); void writeModel( final Model model, final File target); }
PomIO { 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 ); } }  List<Project> parseProject( final File pom ); ProjectVersionRef rewritePOMs( final Set<Project> changed ); void writeModel( final Model model, final File target);  }