license-maven-plugin
license-maven-plugin copied to clipboard
Use strategy pattern to load property-like files
For features like missingFile(Url), licenseMergesFile/Url and overrideFile/Url use a strategy pattern to load the resource so we don't have to pass several strings around.
All those strategies need to return SortedProperties
.
This would allow to reuse the code to load those property-like files from any source (incl. common error handling).
It would also reduce the number of parameters / fields copied around since you would only have to pass one instance for each feature, no matter how complicated it is configured.
If a feature is disabled, we can use a strategy which just returns an empty map.
I am open to see the PR. Please note that the number of added lines of code must be proportional to the declared purpose. I see this as a refactoring that should be neutral or ideally negative in terms of added LoC.