jenkinsci / plugin-pom

Parent POM for Jenkins Plugins
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
MIT License
67 stars 75 forks source link

Add PowerMock to banned dependencies #847

Closed basil closed 10 months ago

basil commented 10 months ago

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