Well if you are deploying it to an app server that this jar is being used by a webapp. So in the web.xml for the web app simply initialize the context for the jar as well.
Code:
<!-- Location of Java @Configuration classes that configure the components that makeup this application -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.sample.application.jar.config;com.sample.application.webapp.config</param-value>
</context-param>
Or if you are using xml rather than java config then define those instead of the packages containing the @Configuration classes like this: (Note this assumes your context.xmls end in 'context.xml' you can list them out or adjust the wild card as needed)
Code:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:**/*context.xml
</param-value>
</context-param>