0

I have two java maven projects : project A and project B.

When I build ("mvn clean install") project A it generates source code java class in target folder.

Project B has a dependency on these generated classes from project A.

Unfortunately on project B it generates error because these classes are not found. I would like to add these classes to build path.

I can do : properties > configure buildpath but...

1) Do I have to do this on project A or project B 2) When I arrive to "configure buildpath" I don't know what to do next.

Thank you

AntonBoarf
  • 1,239
  • 15
  • 31
  • You're missing the point of Maven. Maven's main goal is to let you specify the dependencies of your project in the pom.xml file. Eclipse should (and does) deduce the necessary build path from that. When you do mvn clean install, Maven compiles the classes and generates a jar, **and publishes it in your local Maven repository**. So, if you add a dependency for the group/artifact/version of project A in the pom of project B, Maven and Eclipse will find the necessary jar files in your local Maven repository. – JB Nizet Nov 04 '18 at 17:32
  • I don't know, my problem is similar to this one : https://stackoverflow.com/questions/1192596/how-do-i-get-eclipse-to-resolve-classes-generated-with-maven-2 – AntonBoarf Nov 04 '18 at 17:37
  • You don't know what? Have you read my comment? Is there something you don't understand in it? – JB Nizet Nov 04 '18 at 17:39

0 Answers0