0

I am working on a java project A which is using a class from project B. I added project B in the build path of Project A, I am getting error at compile time for the classes I have used from project B but when I run project A it is showing error ClassNotFound error for the dependencies of project B.

Is there any way I can solve this without adding all the dependencies of project B in build path of project A ? Both Project A and B are maven project.

  • are you using maven? – SUMIT May 05 '20 at 12:07
  • Yes both of them are maven project – boost_insane May 05 '20 at 12:09
  • Then instead of putting in classpath, you add dependency of project B in project A. That should solve your problem. – SUMIT May 05 '20 at 12:48
  • In my understanding, we need to provide the jar while using dependency in maven and I am working simultaneously on both the projects so I cannot actually add project B as dependency directly. Correct me if I am wrong here. Is there any way of adding the project folder as maven dependency? – boost_insane May 05 '20 at 13:07
  • There should not be any sort of cyclic dependency.. means project a can be build after adding dependency from project b, but project b should be build indepndently of project a. When you are doing frequent changes just execute mvn clean install for both of the project... your changes will be reflected – SUMIT May 05 '20 at 19:26

0 Answers0