apache / apache/maven-resources-plugin
[MRESOURCES-291] CopyResourcesMojo and TestResourcesMojo is NOT thread-safe
- Dominant language
- Java
- Stars
- 61
- Forks
- 36
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 3
Description
**[Jin Xu](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=xenoamess)** opened **[MRESOURCES-291](https://issues.apache.org/jira/browse/MRESOURCES-291?redirect=false)** and commented
If you try to make several sub-projects using this plugin to copy resources from some folter to a same folder, or even overwriting some files, it would crush.
I don't think this be thread-safe.
I see the codes. you are using File.mkdirs, which is actually not thread-safe. also, you are using file writing functions, which is not thread safe if multiple threads trying to write to a same file.
So I don't think it is good to annote these 2 mojos as thread-safe.
Please either remake that part, or remove the thread-safe annotation.
Or simply add a synchronized to that function might also be acceptable.
---
No further details from [MRESOURCES-291](https://issues.apache.org/jira/browse/MRESOURCES-291?redirect=false)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.