Refresh Gradle Project breaks JUnit 5 test in Eclipse

I have made a basic Gradle Groovy project. I am using Junit 5 for testing. Run as -> JUnit test causes “No tests found with test runner JUnit 5” error in Eclipse. If I remove the Project and External Dependencies from the Build Path and add Groovy Libraries and JUnit 5 library it runs fine. I believe the conflict may be caused by junit-platform-launcher-1.3.1 jar added into Project and External Dependencies. Any suggestions? Is there a way to add some code to build.gradle to remove junit-platform-launcher-1.3.1 jar?
(using: Eclipse IDE for Java Developers 2019-03, Buildship 3.0.1)

Does the same thing work on the command line?

In any case, you can remove the jar from the classpath container with the following snippet.

eclipse.classpath.file.whenMerged {
  entries.removeAll { it.path.endsWith('junit-platform-launcher-1.3.1 jar') }

I believe that I ran into this problem today. This is my build.gradle


I see that Eclipse is using a later version. The version can be seen in this location.


Add Libraries


I modified it.


That leaves me with a follow up question. Can gradle read the current version of JUnit from Eclipse?