Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-561

Encoding is broken when filtering is enabled

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.2.1
    • 2.2.2
    • None
    • None

    Description

      My resources are encoded in ISO-8859-1. I have specified encoding in the pom:

      <project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>

      I have written a custom assembly file and I am using resource filtering.

      ...
      <fileSet>
      	<directory>${project.basedir}/src/main/resources/</directory>
      	<outputDirectory>/</outputDirectory>
      	<filtered>true</filtered>
      </fileSet>
      ...

      As a result all the french characters are broken in the resulting zip assembly. My platform is Linux so the default platform encoding is UTF-8.

      I have checked plugin code and I think I found the issue. This is in FileFormatter.java, method doFileFilter():

                  configSource.getMavenFileFilter().copyFile( source, target, true, configSource.getProject(),
                          configSource.getFilters(), isPropertiesFile, null, configSource.getMavenSession() );
      

      You can see that enconding is set to null, so I think it means using default platform encoding... Would it be possible to use value of project.build.sourceEncoding instead?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jdcasey John Dennis Casey
            henryju Julien HENRY
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment