Hello everyone, 

I've got an runnable JAR file running well with some Shell scripts. With some spring application context configuration files. 

 

Now we are working with another web application (Struts + Spring + JPA / Hibernate), in which we wanna reuse the logic in the jar file. I'm just curious, is there a way we can just include the runnable jar file in library, and reuse it? And how do we configure to have the runnable jar file to reuse the web application's datasource configuration? 

Which is, our web application have multiple datasource defined, like Test Datasource, Dev datasource, and production datasource, how to make sure our jar file will use that datasource whenever the web application is switching between datasources?