Skip to content

Conversation

timja
Copy link
Member

@timja timja commented Jun 16, 2023

Prior to this junit 4.x was bringing in hamcrest-core, causing jenkinsci/workflow-support-plugin#220 to fail:

mvn dependency:tree | grep -B3 -A 2 hamcrest-core
[INFO] |  |  \- com.shapesecurity:salvation2:jar:3.0.1:test
[INFO] |  +- io.jenkins.lib:support-log-formatter:jar:1.2:test
[INFO] |  +- junit:junit:jar:4.13.2:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] |  +- org.eclipse.jetty:jetty-security:jar:10.0.15:test
[INFO] |  |  \- org.eclipse.jetty:jetty-server:jar:10.0.15:test

See the docs:
https://hamcrest.org/JavaHamcrest/distributables

Care must be taken when upgrading from Hamcrest 1.3 or earlier. Due to the change in packaging, the version conflict resolution that happens in dependency management tools won’t happen automatically. A common example is projects that depend upon JUnit 4. JUnit 4 declares a transitive dependency upon hamcrest-core-1.3.jar. Because hamcrest-core is not the same artifact as hamcrest, it will not be upgraded.

Amends #762

Testing done

I've tested with a snapshot version of the pom:

mvn dependency:tree | grep -B3  hamcrest-core
[INFO] +- org.jenkins-ci.main:jenkins-test-harness:jar:2025.v6f97169a_d6a_f:test
[INFO] |  +- io.jenkins.lib:support-log-formatter:jar:1.2:test
[INFO] |  +- junit:junit:jar:4.13.2:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:2.2:test
### 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

Copy link
Member

@NotMyFault NotMyFault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JUnit 4, my beloved

@timja timja merged commit d5242a1 into jenkinsci:master Jun 16, 2023
@timja timja deleted the fix-hamcrest branch June 16, 2023 08:19
@basil
Copy link
Member

basil commented Aug 28, 2023

Should have been side-ported to jenkinsci/pom as in #475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants