[m2e-users] Why is a project failing to find classes that are clearly in maven dependencies?
- From: "KARR, DAVID" <dk068x@xxxxxxx>
- Date: Sat, 26 Jun 2021 23:31:31 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=att.com; dmarc=pass action=none header.from=att.com; dkim=pass header.d=att.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/j2HKNj60r7K5dmdH2KRCUVLw/YPPEPpsleOGPj9iy8=; b=nN+AptjriZoTnlbcRVS6Qe/STRQhq19RR6DOCXubXflmmN9Y6PSgv0Yp1Im0845Sihxfnzfd13SonXcq45nk8/RUTp3S8OZYPPnPeMvyOibkaDLrn13IOK2ecCySKwQ0RsLQCOdFd0Mz+KJ+cHXziM1ekLFyFviGQwhkvqSAKtMONRRWZyqpQOAwv7NCdNUbzVGXON2xuQ8mWd9xeHk9PEDYaWVQUZvCySnWVMXgkULqS9AQLmEISu8JVQ2E74w5xaZOaL0dQdQC0jZ9s4VmbM5xUbG5gLJmudhZKyjqftMLN+HZuEJgwyoOVuY6BK4wKxjuz3afG4xXWN3QH7vhYA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KDzCLMivyycAM9sv+m4yaoh371mFqt1RL2dYagSTVvVs9otNoFaYuWA14KH4kLJEtIELaniBgGMB3yYdyAc4giXerDz38PyD08ir2AaYFBXU44qtdGy0PgpLs0lAVoiuwJcmXwWV6EoeD0PAZMNh12BPLH5zR8D9i4K/4tzrhfK83KoDvbdMrafGwqNw4M79YQ2vkhYCbXQ/Rax/m4fcuyDtbhyiNKnv2LF5XQJY2GpLMk8Eb4BVRCe33d9oTL7DnYH0px5ISS0itkaguVxw7tVl6ysRsQQGvm5agogn/Sh1IQfuCgtVYAZsRZPthf4GGmyNst/SjMofHpoEvcE24w==
- Delivered-to: m2e-users@xxxxxxxxxxx
- List-archive: <https://www.eclipse.org/mailman/private/m2e-users/>
- List-help: <mailto:firstname.lastname@example.org?subject=help>
- List-subscribe: <https://www.eclipse.org/mailman/listinfo/m2e-users>, <mailto:email@example.com?subject=subscribe>
- List-unsubscribe: <https://www.eclipse.org/mailman/options/m2e-users>, <mailto:firstname.lastname@example.org?subject=unsubscribe>
- Thread-index: Addq4WEmgfc8dBInTDq2cadG9Swa/w==
- Thread-topic: Why is a project failing to find classes that are clearly in maven dependencies?
I work on many SpringBoot projects that are built with Maven, and which have been worked on in Eclipse. We are compiling projects with Java 8, but I use close to the latest version of Java to run Eclipse.
I'm looking at one project that is giving me problems. It has some additional dependencies that are a little different from other services, but I don't know if that's causing a problem.
My current test case includes installing a fresh installation of Eclipse 2021-03, installing several plugins, cloning the project from the git repository, then importing the project from the git repository. This results in numerous compile errors, mostly for missing classes, all of which are clearly shown in the jars in the "Maven Dependencies" list. I first noticed this problem using 2021-06, and I backtracked to 2021-03, but it happens there also.
The command line Maven build of "mvn clean package" completes without error.
As an example of the errors I see, the first compile error in the "Problems" view shows a file where the first compile error in the file refers to an import of "org.mockito.InjectMocks", and the error says "The import org.mockito cannot be resolved". If I then go over to the package explorer and inspect this project, expanding the "Maven Dependencies" item in the tree, I can scroll through the many Maven dependencies until I find "mockito-core-126.96.36.199.jar", which I can expand, showing "org.mockito", and in that package I find the "InjectMocks" class, which I can open up to inspect, which looks perfectly fine.
I do note that in the "Maven Dependencies" list, some dependencies have an icon that looks like a clear jar, and some look like a dark jar. This dependency is one of the dark ones. Looking through the list, the dark jars are less common than the clear jars, and I think that many of the "clear" ones that I see are ones that I'm pretty sure are referenced, and many of the dark jars are ones that I'm surprised to see, as I'm not aware of any code of ours that uses it. Perhaps the "dark" jar means it's a transitive dependency. I have no idea. I tried to find a mention of this distinction on the internet, but I couldn't find any.