-1

I have multiple projects in my workspace and I am using Tomcat 8 and maven ex :

Project A |_ Class A

Project B |_ Class B - this is using class A methods

while running on tomcat class B is not getting data from methods of class A.(it's working if I run it as a java file)

I have added Project A into Project B's Java Build Path and in deployment assembly.

Gourav Soni
  • 75
  • 2
  • 11

2 Answers2

0

Right click on the project B Click 'Configure build path'. Click the Projects tab on that. Click on Add to add Project A. You will get the project A reference in Project B.

Add your files at runtime Right click on your project and choose configurations. Choose classpath tab and add the projectA. Add it your classpath.

While compiling the eclipse will refer the other dependency projects. While running you have to add it to class path of your runtime.

Shriram
  • 4,343
  • 8
  • 37
  • 64
0

I found the answer using maven parent-child module . we just need to create parent.pom in which we will have to add all child modules. and now create web project which need to deploy on server .. and others with maven project and you can add dependancy in web project's pom of maven projects.

Gourav Soni
  • 75
  • 2
  • 11