From e7d408fddac874d9f6863fe753ccfe18477a9f4a Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Mon, 2 Mar 2009 12:01:21 +0000 Subject: [PATCH] o Fixed encoding error during unmarshalling git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@749283 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/project/builder/PomClassicDomainModel.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java b/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java index e1d26808be..f504f6759a 100644 --- a/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java +++ b/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java @@ -68,10 +68,14 @@ public class PomClassicDomainModel implements InputStreamDomainModel public PomClassicDomainModel( List modelProperties ) { this.modelProperties = modelProperties; - try { - inputBytes = IOUtil.toByteArray( ModelMarshaller.unmarshalModelPropertiesToXml(modelProperties, ProjectUri.baseUri)); - } catch (IOException e) { - + try + { + String xml = ModelMarshaller.unmarshalModelPropertiesToXml( modelProperties, ProjectUri.baseUri ); + inputBytes = xml.getBytes( "UTF-8" ); + } + catch ( IOException e ) + { + throw new IllegalStateException( "Unmarshalling of model properties failed", e ); } initializeProperties( modelProperties ); }