We have several Java services that are wired together with Spring, and many jars shared between these services that provide @Components.
Due to pervasive copy and pasting, the pom files for the component jars have ended up with the full list of Spring dependencies that the full services require.
What is the recommended minimal set of Spring dependencies that a shared jar should have?
What is the recommended minimal set of Spring dependencies that a shared jar should have?
I don’t think there is one as it depends on the scope of your shared JAR. If the JAR contains classes covering aspects of different layers (persistence, presentation, etc.) you may need “everything”. In the worst case and if it’s really complex, reverse-engineering may be your last resort: remove all dependencies not required at compile time and then test, test, test… I know – painful 🙂