Reputation: 86865
I'd like to define some commonly used or generic service classes that should be used/shared by different projects. These common services should already make use of @Transactional
, @Autowired
and other Spring
related stuff. So, I somehow have to define a spring context for these services to work.
Is it possible to put these services in a single external jar
library that can then be used/imported by other (child)-projects? How could I create such a "personal framework"?
Upvotes: 0
Views: 259
Reputation: 64059
What you could do is create a maven (or gradle) module that contains the code you desire to be reusable and also have a spring configuration (either XML or Java Config) that will be imported by the project that uses the module (either with or having component scanning pick up the @Configuration class of the module).
Upvotes: 1