I have a standalone spring project which is working fine. While running the project I simply load the application context in the main method like:
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application-context.xml");
SampleBean sampleBean = (SampleBean) context.getBean("sampleBean");
and things get moving.
Now I have to create a jar file for this project and include it in another Maven project which is not a Spring project. Here, I have to call the functions present in the included Spring jar file using classes which in itself contain autowiring.
Now since I am directly calling the Class function without loading the application context, other dependencies of autowiring are failing.
Please suggest how do I load the application context of the included Spring jar.