What are the minimum jars needed for spring to be used in a standalone application?
It is possible that some of the transitive dependencies may be unused, but there is no automated way to determine this. You can exclude all transitive dependencies to start with (using excludes tag), build/run the app and keep adding appropriate dependencies, when you get an error. Some of them would fail compilation, others fail app at runtime.
fresh_dev
Updated on June 07, 2022Comments
-
fresh_dev almost 2 years
him i am using spring in a standalone application for Dependency injection, MessageSource & PropertyPlaceHolder support, Hibernate/JDBC support,unit testing, and i was wondering what are the minimum jars needed for above requirements, and if i can exclude some jars or dependencies form my current configuration, since i don't need the application size to be big as it's a standalone application, i need to make the application size as small as i can, here's the dependencies i am using right now:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>${spring.version}</version> </dependency>
UPDATE:
After minimizing the dependencies to:
- spring-core.
- spring-beans.
- spring-context.
- spring-context-support.
- spring-expression.
- spring-jdbc.
- spring-orm.
- hibernate-entitymanager.
- validation-api.
- hibernate-validator.
- junit.
- commons-logging.
- slf4j-simple.
- log4j.
- derby.
- cglib.
i still see some jars which i am not sure if they are important to my requirements or not:
- activation-1.1.jar
- antlr-2.7.6.jar
- aopalliance-1.0.jar
- asm-3.3.1.jar
- commons-collections-3.1.jar
- dom4j-1.6.1.jar
- javassist-3.9.0.GA.jar
- jms-1.1.jar
- mail-1.4.jar
- spring-aop-3.0.5.RELEASE.jar
- spring-asm-3.0.5.RELEASE.jar
- spring-tx-3.0.5.RELEASE.jar
- xml-apis-1.0.b2.jar
PLEASE advise if i should exclude some jars from them.