0

I have two maven projects. Project A is dependent on project B. The dependencies are defined in the pom.xml (as shown here : how to add dependency of other maven project to my current maven project in java eclipse?) and the compiler is happy. However when Project A startups it throws a ClassNotFoundException. I am using eclipse.

How do I fix this runtime exception?

dasPing
  • 337
  • 1
  • 2
  • 19
  • 1
    Is project B a *Maven dependency* or just an Eclipse dependency? Is project B on the build path of project A? Also, the class which is not found, where is it located within project B? Is it in its `src/main/java` folder or is it somewhere else? – Andrei Aug 11 '17 at 14:32
  • Build path was the problem : properties -> java build path -> add project. Lovely – dasPing Aug 13 '17 at 21:18

1 Answers1

0

Adding Project B artifact as dependency to Project A should do it , as answered in the question link you posted. Have you set scope for the dependency? (Sorry, this should have been a comment but dont have enough reputation for that!)

Nima AJ
  • 1
  • 1
  • The scope I have not defined. Runtime class loading might be a bit tricky because it is a spring application. – dasPing Aug 11 '17 at 13:45