PowerMock tends to wreak havoc when it is on the classpath at the same time as Mockito in newer Java versions, so ban this dependency. I have not banned org.powermock:powermock-reflect since it is actually safe and some plugins (like Blue Ocean) depend on it. But I have banned every other PowerMock artifact.
Testing done
I tested this in context in a plugin that used powermock-reflect. Attempting to add another PowerMock package caused (as expected):
Rule 4: org.apache.maven.enforcer.rules.dependency.BannedDependencies failed with message:
org.jenkins-ci.plugins:build-blocker-plugin:hpi:1.7.10-SNAPSHOT
org.powermock:powermock-module-junit4:jar:2.0.9 <--- banned via the exclude/include list
### Submitter checklist
- [ ] Make sure you are opening from a **topic/feature/bugfix branch** (right side) and not your main branch!
- [ ] Ensure that the pull request title represents the desired changelog entry
- [ ] Please describe what you did
- [ ] Link to relevant issues in GitHub or Jira
- [ ] Link to relevant pull requests, esp. upstream and downstream changes
- [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
PowerMock tends to wreak havoc when it is on the classpath at the same time as Mockito in newer Java versions, so ban this dependency. I have not banned
org.powermock:powermock-reflect
since it is actually safe and some plugins (like Blue Ocean) depend on it. But I have banned every other PowerMock artifact.Testing done
I tested this in context in a plugin that used
powermock-reflect
. Attempting to add another PowerMock package caused (as expected):