mirror of https://github.com/apache/maven.git
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:
parent
47d9a60537
commit
df59dabb75
|
@ -64,3 +64,6 @@ plugin registry and settings should be stored in the tool specific locations
|
|||
|
||||
<eu> -- properties param on execute() method
|
||||
<eu> -- transfet listener and loggers, system out cleanup
|
||||
|
||||
<eu> one more thing I need in embedder - writeModel() method
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
|
|||
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
|
||||
import org.apache.maven.model.Model;
|
||||
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.DefaultProfileManager;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
@ -61,6 +62,7 @@ import java.io.FileReader;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.Writer;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
@ -95,6 +97,8 @@ public class MavenEmbedder
|
|||
|
||||
private MavenXpp3Reader modelReader;
|
||||
|
||||
private MavenXpp3Writer modelWriter;
|
||||
|
||||
private ProfileManager profileManager;
|
||||
|
||||
private PluginDescriptorBuilder pluginDescriptorBuilder;
|
||||
|
@ -242,6 +246,12 @@ public class MavenEmbedder
|
|||
return modelReader.read( new FileReader( model ) );
|
||||
}
|
||||
|
||||
public void writeModel( Writer writer, Model model )
|
||||
throws IOException
|
||||
{
|
||||
modelWriter.write( writer, model );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Project
|
||||
// ----------------------------------------------------------------------
|
||||
|
@ -517,6 +527,8 @@ public class MavenEmbedder
|
|||
|
||||
modelReader = new MavenXpp3Reader();
|
||||
|
||||
modelWriter = new MavenXpp3Writer();
|
||||
|
||||
pluginDescriptorBuilder = new PluginDescriptorBuilder();
|
||||
|
||||
profileManager = new DefaultProfileManager( embedder.getContainer() );
|
||||
|
|
Loading…
Reference in New Issue