Maven 2 & 3

POM is still not read using the right encoding

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0.8
  • Component/s: POM::Encoding
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    2

Description

IIRC XML standard says that default encoding is UTF-8 for xml files

That can be overriden with
<?xml version="1.0" encoding="ISO-8859-1"?>

But files without header saved as UTF8 are not parsed in some systems (eg windows, solaris), while files saved as other encoding (I believe it was ansi) break under a Mac mini with yellowdog linux

Issue Links

Activity

Hide
Stefan Hübner added a comment -

This issue is a clone of MNG-1603. Sorry, The Fix Version is not correct due to cloning (I misunderstood this cloning feature slightly.)

My experiences working with encodings is, that Maven actually DOES NOT read model files using the right encoding. It might be true, that the declared encoding is read and attached to the model. But certain field like description are read using the default system character set, which isn't the same as the POM's encoding in all cases.

I'll provide test cases both for maven-model and maven-project to demonstrate the problem.

Again, sorry for the misleading issue data by cloning MNG-1603.

Regards,
Stefan

Show
Stefan Hübner added a comment - This issue is a clone of MNG-1603. Sorry, The Fix Version is not correct due to cloning (I misunderstood this cloning feature slightly.) My experiences working with encodings is, that Maven actually DOES NOT read model files using the right encoding. It might be true, that the declared encoding is read and attached to the model. But certain field like description are read using the default system character set, which isn't the same as the POM's encoding in all cases. I'll provide test cases both for maven-model and maven-project to demonstrate the problem. Again, sorry for the misleading issue data by cloning MNG-1603. Regards, Stefan
Hide
Stefan Hübner added a comment -

This patch adds two model-files encoded in two different ways. The patch also provides test cases which try to read those models and check the read data.

Show
Stefan Hübner added a comment - This patch adds two model-files encoded in two different ways. The patch also provides test cases which try to read those models and check the read data.
Hide
Stefan Hübner added a comment -

This patch demonstrates the encoding issue in maven-project. Again it provides two POMs encoding in different ways. It provides test cases trying to read those POMs and validate the read data.

Show
Stefan Hübner added a comment - This patch demonstrates the encoding issue in maven-project. Again it provides two POMs encoding in different ways. It provides test cases trying to read those POMs and validate the read data.
Hide
Stefan Hübner added a comment -

PLX-214 describes the actual cause of this issue very nicely.

Show
Stefan Hübner added a comment - PLX-214 describes the actual cause of this issue very nicely.
Hide
Brian Fox added a comment -

I applied the maven-project unit tests and those were already fixed by MNG-2254. The maven model tests are still failing however

Show
Brian Fox added a comment - I applied the maven-project unit tests and those were already fixed by MNG-2254. The maven model tests are still failing however
Hide
Brian Fox added a comment -
Show
Brian Fox added a comment - The model patch is applied to 2.0.x here: http://svn.apache.org/repos/asf/maven/components/branches/maven-model-mng2025
Hide
Brian Fox added a comment -

Actually the project units are failing on 2.0.x too.

Show
Brian Fox added a comment - Actually the project units are failing on 2.0.x too.
Hide
Brian Fox added a comment -

fixed

Show
Brian Fox added a comment - fixed

People

Vote (4)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: