Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Configuration for various formatter steps can be located in separate files. Such files might live in the local filesystem and be identified as simple paths. They can also be remote files identified by a URL. Both types of files are copied to the output directory using Maven's
ResourceManager
which can handle both local and remote files.Previously, plugin tried to deduce the output file name based on the configured string. This was done using
FileUtils#filename()
method that expects to only work with system file separators. Issue occurred on Windows when URL was specified. Path separator on Windows is\
and in URL it is/
. Code wasn't able to extract the last path of the URL that denotes the file name. Instead, it treated the whole URL as a file name. URLs contain chars invalid for Windows paths and an exception was thrown on attempt to create the file.This PR fixes the problem by making code use predefined name pattern for all resolved resources. Name of the output file will not be guessed based on the configured path or URL. It will just be unique and have 'spotless-resource-' prefix.
Fixes #250