Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 517763

Summary: Maven project with workspace resolution enabled pulls in improper junit jar from eclipse pool
Product: [Eclipse Project] JDT Reporter: Adam Ringel <work.asr>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 4.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Adam Ringel CLA 2017-06-02 18:44:00 EDT
A maven project with special junit version needs has junit 4.11 defined in its pom.
It has dependencies on two workspace maven projects that are defined with junit 4.12 in the pom.
When workspace resolution is enabled the unit tests fail because the junit 4.12 jar is put onto the classpath from the plugins pool:

...
	X:\.m2\repository\junit\junit\4.11\junit-4.11.jar;
...
	X:\projB\target\classes;
	X:\projC\target\classes;
	X:\.p2\pool\plugins\org.junit_4.12.0.v201504281640\junit.jar;
	X:\.p2\pool\plugins\org.hamcrest.core_1.3.0.v201303031735.jar;
...

When workspace resolution is disabled, the plugin jars disappear and it works properly.

...
	X:\.m2\repository\junit\junit\4.11\junit-4.11.jar;
...
	X:\.m2\repository\...\projB.jar;
	X:\.m2\repository\...\projC.jar;
...

No where in the GUI is that plugin jar shown.
Comment 1 Adam Ringel CLA 2017-06-02 19:00:19 EDT
Found that the Junit4 library was on the build path of one of the workspace projects even though it was a Maven project.  Removing it from the build path fixed the problem.