문제

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

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top