Logging: destination path missing when destination equals basedir in DefaultMavenResourcesFiltering
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- build-system
Research direction
Start in DefaultMavenResourcesFiltering.filterResources(), where the copy-operation log uses basedir.relativize(destination). Reproduce or inspect the case where destination equals basedir, then verify that the completed log message identifies the destination as specified by the issue.
Written by the indexing model from the issue text.
Description
Affected version
3.x
Bug description
When DefaultMavenResourcesFiltering.filterResources() logs copy operations it uses Path.relativize against the project's base directory. If the destination path equals basedir (i.e. copy to the basedir directory), basedir.relativize(destination) returns an empty string, so the log message ends with "to ".
For example: "Copying 1 resource from sourcedir to ".
Current code:
LOGGER.info("Copying " + includedFiles.size() + " resource" + (includedFiles.size() > 1 ? "s" : "")
+ " from "
+ basedir.relativize(resourceDirectory.toAbsolutePath())
+ " to "
+ basedir.relativize(destination));
The log message should show the destination path:
- "." or
- the absolute path or
- "basedir" / "project base directory"
Suggested code change:
LOGGER.info("Copying " + includedFiles.size() + " resource" + (includedFiles.size() > 1 ? "s" : "")
+ " from "
+ basedir.relativize(resourceDirectory.toAbsolutePath())
+ " to "
+ (basedir.equals(destination) ? "." : basedir.relativize(destination)));
- Dominant language
- Java
- Stars
- 9
- Forks
- 36
- Avg merge
- 6h 44m
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/maven-filtering
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/maven-filtering#358 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
apache/maven-filtering#357 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
apache/maven-filtering#356 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/maven-filtering#354 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/maven-filtering#352 ·
All issues in apache/maven-filtering
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100