jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Compiler Plugin
  • MCOMPILER-63

Provide specific default value for "encoding" parameter

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 2.0.2
  • Fix Version/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes

Description

As stated in the javac doc, the parameter "encoding" defaults to the platform's default encoding if not specified. This might be a convenient feature when running javac directly from the console prompt (less typing) but I consider this harmful for an automated build. The platform's default encoding might easily differ between machines/developers, causing unreliable build output.

Maven has "reproducible builds" on its banner and as such, locking down all plugin versions has recently become a best practice. Likewise, the encoding used to process source files should be locked down. As Maven furthermore prefers convention over configuration, such a lockdown should be provided out-of-the-box.

The attached patch adds a default value for the encoding that locks the encoding down to "ISO-8859-1" if not explicitly overriden by the user in the POM. I chose Latin-1 for consistency with the behavior of the Maven Site Plugin although I personally would have preferred UTF-8.

Releasing the patch might break existing builds where users have relied on their platform's default encoding for handling Non-ASCII sources. The group of those people is hopefully small and their build can be easily fixed by updating the POM.
Not emulatable would be the possibility to explicitly use the platform's default encoding as now but I do not think that there is really somebody out there playing russian roulette with the build output... Besides, now one requested such a risky thing for the Maven Site Plugin.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    source-encoding.patch
    15/Jan/08 5:15 AM
    0.6 kB
    Benjamin Bentmann

Issue Links

is superceded by

Improvement - An improvement or enhancement to an existing feature or task. MCOMPILER-70 use ${project.build.sourceEncoding} as default value for "encoding" parameter

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Improvement - An improvement or enhancement to an existing feature or task. MCOMPILER-73 Warn about usage of platform encoding

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. MJAVADOC-165 Provide specific default value for "encoding" parameter

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Vincent Siveton added a comment - 15/Jan/08 9:24 PM

Applied in r612342 Thanks!
For the record, I liked your Maven philosophy point about the "reproducible builds".

Show
Vincent Siveton added a comment - 15/Jan/08 9:24 PM Applied in r612342 Thanks! For the record, I liked your Maven philosophy point about the "reproducible builds".
Hide
Permalink
Benjamin Bentmann added a comment - 02/May/08 3:41 AM

Default needs to be reverted to platform encoding according to user poll.

Show
Benjamin Bentmann added a comment - 02/May/08 3:41 AM Default needs to be reverted to platform encoding according to user poll.
Hide
Permalink
Benjamin Bentmann added a comment - 03/May/08 6:40 AM

Reverted in r653054.

Show
Benjamin Bentmann added a comment - 03/May/08 6:40 AM Reverted in r653054.

People

  • Assignee:
    Benjamin Bentmann
    Reporter:
    Benjamin Bentmann
Vote (0)
Watch (0)

Dates

  • Created:
    15/Jan/08 5:15 AM
    Updated:
    03/May/08 6:40 AM
    Resolved:
    03/May/08 6:40 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.