o adding model writer for eu

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@292812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2005-09-30 16:46:59 +00:00
parent 47d9a60537
commit df59dabb75
2 changed files with 15 additions and 0 deletions

View File

@ -64,3 +64,6 @@ plugin registry and settings should be stored in the tool specific locations
<eu> -- properties param on execute() method <eu> -- properties param on execute() method
<eu> -- transfet listener and loggers, system out cleanup <eu> -- transfet listener and loggers, system out cleanup
<eu> one more thing I need in embedder - writeModel() method

View File

@ -24,6 +24,7 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.resolver.ArtifactResolutionException; import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.model.Model; import org.apache.maven.model.Model;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader; import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
import org.apache.maven.profiles.ProfileManager; import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.profiles.DefaultProfileManager; import org.apache.maven.profiles.DefaultProfileManager;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
@ -61,6 +62,7 @@ import java.io.FileReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.InputStream; import java.io.InputStream;
import java.io.Writer;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -95,6 +97,8 @@ public class MavenEmbedder
private MavenXpp3Reader modelReader; private MavenXpp3Reader modelReader;
private MavenXpp3Writer modelWriter;
private ProfileManager profileManager; private ProfileManager profileManager;
private PluginDescriptorBuilder pluginDescriptorBuilder; private PluginDescriptorBuilder pluginDescriptorBuilder;
@ -242,6 +246,12 @@ public class MavenEmbedder
return modelReader.read( new FileReader( model ) ); return modelReader.read( new FileReader( model ) );
} }
public void writeModel( Writer writer, Model model )
throws IOException
{
modelWriter.write( writer, model );
}
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
// Project // Project
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
@ -517,6 +527,8 @@ public class MavenEmbedder
modelReader = new MavenXpp3Reader(); modelReader = new MavenXpp3Reader();
modelWriter = new MavenXpp3Writer();
pluginDescriptorBuilder = new PluginDescriptorBuilder(); pluginDescriptorBuilder = new PluginDescriptorBuilder();
profileManager = new DefaultProfileManager( embedder.getContainer() ); profileManager = new DefaultProfileManager( embedder.getContainer() );