Question

I have a standalone.jar which will be packaged inside super.war. Stanalone.jar uses a function from super.war. My confusion is how can I call a method from super.war when I am developing a functionality inside a class in my war since both of them are different projects in eclipse?

To elaborate more:

Super.war has a class call Motors which has a method called getMotors. standalone.jar has a class called Customer which needs to call getMotors of super.war. Now, my question is how can I create an object and call a method of Motors class which is in war inside Customers class which is in jar.

Please help.

Thank you

Was it helpful?

Solution

You need the project containing the Motors class to be on the build path of the standalone.jar project.

If you also need the standalone.jar project to be on the build path of the WAR project, then it seems you have a cyclic dependency between these projects which you should break; perhaps by putting the common classes in a 3rd project/jar.

OTHER TIPS

You can't. By doing this, standalone.jar wouldn't be so standalone any more. :) You would probably create a circle-ref.

You'll have to find a way to use some common interface.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top