Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotbugs Xml Output file Locked After Execution (Windows only) #517

Closed
mcordeiro73 opened this issue Dec 16, 2022 · 2 comments
Closed

Spotbugs Xml Output file Locked After Execution (Windows only) #517

mcordeiro73 opened this issue Dec 16, 2022 · 2 comments
Assignees

Comments

@mcordeiro73
Copy link

When attempting to run mvn clean verify package clean with version 4.7.3.0 of the spotbugs-maven-plugin, I get the below error in the execution of the second clean goal.

Note: This did not occur when using older versions of the spotbugs-maven-plugin (I am upgrading from version 4.5.3.0).

Some observations made while looking into this issue:

  • It only appears to occur on Windows. When attempting to recreate on macOS the issue did not occur.
  • It only occurs when executing as a single goal string. If instead the second clean is split into another mvn command the clean works without issue.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:09 min
[INFO] Finished at: 2022-12-16T14:27:04-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project sample-project: Failed to clean project: Failed to delete C:\Workspaces\Workspace1\Project\target\SpotbugsReport\spotbugsXml.xml -> [Help 1]
@hazendaz
Copy link
Member

@mcordeiro73 Please try this with modern plugins. clean 2.5 is too old to even consider looking at. Please use the latest on your plugins to see any differences. Other than that try to look at the commit history between 4.5.3 and 4.7.3 as you noted. Most likely you will discover its not likely here but more likely spotbugs. However, I cannot be 100% sure on that without seeing this with more recent plugin usage. Its bad to sit on mavens internal defaults. That will be changing fast with maven 3.9 / 4.0 series but where you are at make sure you define all the plugins being used. 2.5 for example is a decade old. The new one works differently even in case of locks which I presume is your encountered issue of sorts.

@hazendaz hazendaz self-assigned this Feb 21, 2023
hazendaz added a commit to hazendaz/spotbugs-maven-plugin that referenced this issue Feb 25, 2023
Test simply runs through clean at end to ensure files not still open.  Using 4.7.3.0, I can repeat the reported issue.  The issue is gone in 4.7.3.1 and likely related to the auxpath issue.
hazendaz added a commit to hazendaz/spotbugs-maven-plugin that referenced this issue Feb 25, 2023
Test simply runs through clean at end to ensure files not still open.  Using 4.7.3.0, I can repeat the reported issue.  The issue is gone in 4.7.3.1 and likely related to the auxpath issue.
hazendaz added a commit that referenced this issue Feb 25, 2023
[tests] Add integration test to check file open issues per #517
@hazendaz
Copy link
Member

Assuming this may have been related to aux path system in logic we replaced as we did nothing for this and issue is now gone. I've wrote a unit test for this #553 to ensure it does not pop up again. I was able to confirm condition with same test using 4.7.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants