Monday, September 1, 2014

Amp Archetype for Share build corrupts *.ico image files

When using the amp archetype from alfresco maven sdk for alfresco share, all image files that had an extension of *.ico were corrupted after going through the amp build process.

Research of the parent alfresco-sdk-parent shows that the maven-resources-plugin configures binary extensions that are filtered during the build process. Since *.ico files were not included, these file extensions are corrupted during the build process.

Instead of putting in a trouble ticket on the google maven-alfresco-archetypes project, the workaround solution was to to append additional filtered extensions that the alfresco-sdk-parent doesn't have to the child share maven module's pom.  Note the combine.children="append" attribute on the nonFilteredFileExtensions tag, this way you don't have to completely override by repeating the parent's nonFilteredExtensions config, just append to it.

NOTE: This was tested on Alfresco Community 4.2.e and would also apply to any other file extensions that get corrupted during the build, mainly binary files.

<!-- Append additional filtered extensions that the alfresco-sdk-parent doesn't have -->
          <nonFilteredFileExtensions combine.children="append">

What questions do you have about this post? Let me know in the comments section below, and I will answer each one.


  1. Hi Judy,

    thanks for the explanation and solution.

    I would be very grateful if you help me with this problem:

    I have many "favicon.ico" files. With some of them there is an excception:

    Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources

    But, with some of them there isn't exception.

    I put "favicon.ico" in the following directory:


    When additional filtered extension, that you mentioned, is added to the pom.xml everything is OK.

  2. Hi Judy,

    I think that I've just found explanation for my problem:


    Warning: Do not filter files with binary content like images! This will most likely result in corrupt output.

    So, if you don't exclude image file from filtering you will most likely have a corrupted output.

    I apologize if I took your time.

    Kind regards,
    Uros Vukasinovic

  3. Hi Uros,

    I don't think I fully understand what your issue in your first comment was. Are you saying that some *.ico fies get corrupted and some don't? Or that if you include some *.ico files in the build, some will cause the error "Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.7:resources"?

    I noticed for any files that are in src\main\amp\web, and under subdirectories this has worked.

    Which version of the alfresco-maven-sdk are you using?

    Also, this maven article shows that you should and can filter binary files or they will get corrupted -

    I wrote another similar article to this issue here as well for your reference -

    Happy coding!


I appreciate your time in leaving a comment!