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 ); }