-
Notifications
You must be signed in to change notification settings - Fork 172
[ARCHETYPE-649] work around warning 'Don't override file...' #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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). 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 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". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a test
@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? |
I think this PR will break feature like https://issues.apache.org/jira/browse/ARCHETYPE-289 |
I hope you guys have a better solution for this, I know that this pull request is no good ;-). The original issue might also be a problem in my own archetype, but I have no idea what could be improved. |
Resolve #487 |
Resolve #897 |
Resolve #487 |
Resolve #897 |
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.