Skip to content

Commit

Permalink
Remove empty hamcrest-core 2.x from 'JUnit 4/5' classpath container
Browse files Browse the repository at this point in the history
Since hamcrest version 2 the 'hamcrest-core' artifact only exists to
redirect to the new 'hamcrest' artifact containing all of hamcrest.
Therefore 'hamcrest-core' does only contains meteadata but no classes.
For the 'JUnit 4/5' classpath container it is therefore useless in
version 2 and later.

References:
- https://hamcrest.org/JavaHamcrest/distributables.html#previous-versions-of-hamcrest
- https://github.com/hamcrest/JavaHamcrest/releases/tag/v2.1
  • Loading branch information
HannesWell committed Aug 26, 2024
1 parent acb89e3 commit 7c2f7fc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,6 @@ public boolean accept(File dir, String name) {
public static final JUnitPluginDescription JUNIT4_PLUGIN= new JUnitPluginDescription(
"org.junit", new VersionRange("[4.13.0,5.0.0)"), null, "org.junit_4.*.jar", "org.junit.source", "source-bundle/", JUnitPreferencesConstants.JUNIT4_JAVADOC); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

private static final JUnitPluginDescription HAMCREST_CORE_PLUGIN= new JUnitPluginDescription(
"org.hamcrest.core", new VersionRange("[2.2.0,3.1.0)"), null, "org.hamcrest.core_2.*.jar", "org.hamcrest.core.source", "source-bundle/", JUnitPreferencesConstants.HAMCREST_CORE_JAVADOC); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

private static final JUnitPluginDescription HAMCREST_PLUGIN= new JUnitPluginDescription(
"org.hamcrest", new VersionRange("[2.2.0,3.1.0)"), null, "org.hamcrest_2.*.jar", "org.hamcrest.source", "source-bundle/", JUnitPreferencesConstants.HAMCREST_JAVADOC); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

Expand Down Expand Up @@ -421,13 +418,6 @@ public static IClasspathEntry getJUnit4as3LibraryEntry() {
return JUNIT4_AS_3_PLUGIN.getLibraryEntry();
}

/**
* @return the org.hamcrest.core library, or <code>null</code> if not available
*/
public static IClasspathEntry getHamcrestCoreLibraryEntry() {
return HAMCREST_CORE_PLUGIN.getLibraryEntry();
}

/**
* @return the org.hamcrest library, or <code>null</code> if not available
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ private static JUnitContainer getNewContainer(IPath containerPath, IClasspathAtt
case JUNIT4:
entriesList.add(BuildPathSupport.getJUnit4LibraryEntry());
entriesList.add(BuildPathSupport.getHamcrestLibraryEntry());
entriesList.add(BuildPathSupport.getHamcrestCoreLibraryEntry());
break;
case JUNIT5:
boolean vintage = isVintage(attributes);
Expand All @@ -145,7 +144,6 @@ private static JUnitContainer getNewContainer(IPath containerPath, IClasspathAtt
entriesList.add(BuildPathSupport.getJUnit4LibraryEntry());
}
entriesList.add(BuildPathSupport.getHamcrestLibraryEntry());
entriesList.add(BuildPathSupport.getHamcrestCoreLibraryEntry());
// errors will be reported above
entriesList.removeIf(e -> e == null);
break;
Expand Down

0 comments on commit 7c2f7fc

Please sign in to comment.