|
Not sure whether we really need this extra complexity. With the fix for Also, I am not in favor of specifying the includes/excludes all in one simple string given that these patterns are usually provided by means of a real collection. That is to say, the usage would become inconsistent IMHO. Can you elaborate more on your specific use case? I saw I considered excluding the default directories from cleaning, and then using the filesets parameter. The problems with this approach however are:
Allowing a simple String to be used, instead of a Collection, allows the patterns to be passed in on the command line. -Dexcludes=**/expensive.file1 It also allows other plugins (this is my use case), which are bound to the pre-clean phase to set this property on the project to avoid specific files being deleted when clean is run. I agree that this usage is somewhat inconsistent. You would have to agree however, that it is extremely practical. IMO, maven should support splitting of comma and space separated Strings into Collection parameters automatically. This is exactly what Ant does. It would make the pom a lot more readable, and allow passing of collection arguments on the command line.
Out of curiosity, could you give some more details on this? For instance, what generated the files to exclude, your plugin or something else? If the files should be excluded from cleaning, why aren't they put somewhere else? How can they ever be deleted by Maven or isn't that intended? My plugin consists of several MOJOs. One of which runs at the end of the build, storing some state about what happened during the build. This data is optionally required for following builds, allowing the build time to be drastically reduced.
Yes, the same plugin generated the files to exclude. However, conceivably they could be produced by any plugin.
They can optionally be put somewhere else. This requires extra configuration (and effort) by the user however. The target directory is the best location for these files however, since they will be removed when the user runs the clean goal, without running my plugin first.
By simply running $> mvn clean, without my mojo being explicitly called first. Also, my mojo will be able to decide when those files are to be deleted. Apart from the use case I describe above, I see this patch to be providing the extremely useful ability to specify excludes and includes on the command line. |
|||||||||||||||||||||||||||||||||||||||
This patch allows the following parameters to be passed to the maven-clean-plugin: