You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "WolfgangHG (via GitHub)" <gi...@apache.org> on 2023/11/30 20:57:53 UTC

[PR] [ARCHETYPE-64] work around warning 'Don't override file...' [maven-archetype]

WolfgangHG opened a new pull request, #160:
URL: https://github.com/apache/maven-archetype/pull/160

   This pull request tries to work around a warning "Don't override file ..." or "CP Don't override file..." that appeared after switching from maven archetype plugin 3.1.2 to 3.2.1 - more details and a sample see https://issues.apache.org/jira/browse/ARCHETYPE-649
   
   The warning seems to be caused by fileset declarations in "archetype-metadata.xml": with 3.2.1, the archetype jar file contains entries for all directories, but before there were only entries for the actual files in the zip. I could also verify this difference by analyzing the jar file with WinZip.
   
   I could work around the warning by switching off "IncludeEmptyDirs" in two places in "JarMojo.execute".
   
   My first thought was to pass the paths of the "archetype-metadata.xml" filesets to the second argument of "DefaultFileSet.includeExclude()", but this did not have any effect - but this might also be caused by me using wrong paths;-)
   
   [DISCLAIMER] This is my first pull request to maven, I don't have knowledge of the internals - just trying to workaround an issue that I run into. Maybe the problem is also caused by me misusing the filesets in "archetype-metadata.xml".
   So please consider this more a start of a discussion that a "I have fixed something" statement ;-). If you have better suggestions to resolve this, please point me to them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ARCHETYPE-64] work around warning 'Don't override file...' [maven-archetype]

Posted by "WolfgangHG (via GitHub)" <gi...@apache.org>.
WolfgangHG commented on PR #160:
URL: https://github.com/apache/maven-archetype/pull/160#issuecomment-1845931487

   @elharo I attached a full sample project to https://issues.apache.org/jira/browse/ARCHETYPE-649. I probably could create a smaller sample (web app project instead of ear project with two modules). But you request a unit test as part of the archetype build process? How could I create such a test project?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ARCHETYPE-64] work around warning 'Don't override file...' [maven-archetype]

Posted by "WolfgangHG (via GitHub)" <gi...@apache.org>.
WolfgangHG commented on PR #160:
URL: https://github.com/apache/maven-archetype/pull/160#issuecomment-1836736679

   About empty directories: one could think that it could be feature in the new version that empty directories are also included in the jar file. But I tried to add empty folders in different places in the archetype source directory structure, and none of them was included in the archetype jar (using archetype plugin 3.2.1, which creates jar entries for all directories, but without my workaround). 
   Several StackOverflow answers suggest to achieve this by using filesets.
   
   Then I found this suggestion which does not work any more with my workaround: https://stackoverflow.com/questions/2786966/how-to-create-empty-folders-with-maven-archetype
   When adding the "maven-resources-plugin" with "includeEmptyDirs=true", then this will work with 3.2.1 as expected: all empty dirs are added. But my workaround breaks this code.
   
   The only solution I could think of: parse "archetype-metadata.xml" and exclude all directories that are defined as root dirs of filesets. But how to do this and how to handle the excludes? As I wrote above, I did not manage to specify exclusions on "DefaultFileSet".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org