0

I have two different projects in which I have two different packages now am importing one package into another. import Exceltwo.guruExcel.*; I have also added the classPath in the project where I want to import my package but when I am creating an object for the imported class(project) it is showing me an error "Cannot resolve to a type".

*Additional information - These are my maven projects

Screenshot

Ambika
  • 61
  • 1
  • 3
  • 6
  • 1
    We need to see where exactly `Cannot resolve to a type` occurred ? – cruisepandey Jun 11 '21 at 18:02
  • See if this helps: https://stackoverflow.com/questions/44074179/how-to-add-local-project-not-jar-as-a-dependency-to-a-maven-project – itronic1990 Jun 11 '21 at 18:04
  • check if there are any maven dependencies missing, try maven update for project by adding missing dependencies to pom.xml – sanjeevRm Jun 12 '21 at 01:08
  • Okay, so one of the projects in which am trying to import is not a maven project. (It is a normal project with a TestNG XML file). Am I facing issues due to this? – Ambika Jun 12 '21 at 16:03
  • @cruisepandey I have added a screenshot for your reference. – Ambika Jun 12 '21 at 16:11

1 Answers1

0

I found the solution by myself

There were following errors that I was doing here:

  1. First, I was trying to import a maven project into a non-maven project.
  2. Secondly, I was importing a default package. (Just avoid doing that!)
  3. I was adding the Class folder in my java build path. (Instead, go to Build path > configure build path > Projects > Add (add your desired project here which you wish to import))

Hope someone will find it useful!!

Ambika
  • 61
  • 1
  • 3
  • 6