Java spring在独立应用程序中使用所需的最少JAR是多少?
我在独立应用程序中使用spring进行依赖项注入,消息源,PropertyPlaceHolder支持,Hibernate/JDBC支持,单元测试,我想知道上述要求所需的最小JAR是多少,如果我可以从当前配置中排除一些JAR或依赖项,因为我不需要应用程序的大小,因为它是一个独立的应用程序,我需要将应用程序的大小设置为小,以下是我现在使用的依赖项:Java spring在独立应用程序中使用所需的最少JAR是多少?,java,spring,maven,dependency-injection,spring-3,Java,Spring,Maven,Dependency Injection,Spring 3,我在独立应用程序中使用spring进行依赖项注入,消息源,PropertyPlaceHolder支持,Hibernate/JDBC支持,单元测试,我想知道上述要求所需的最小JAR是多少,如果我可以从当前配置中排除一些JAR或依赖项,因为我不需要应用程序的大小,因为它是一个独立的应用程序,我需要将应用程序的大小设置为小,以下是我现在使用的依赖项: <dependency> <groupId>org.springframework</groupI
<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>
org.springframework
弹簧芯
${spring.version}
org.springframework
弹簧式
${spring.version}
org.springframework
春豆
${spring.version}
org.springframework
春季aop
${spring.version}
org.springframework
spring上下文
${spring.version}
org.springframework
spring上下文支持
${spring.version}
org.springframework
德克萨斯州春季
${spring.version}
org.springframework
SpringJDBC
${spring.version}
org.springframework
春季甲虫
${spring.version}
org.springframework
弹簧oxm
${spring.version}
org.springframework
弹簧试验
${spring.version}
测试
org.springframework
春季asm
${spring.version}
更新:
将依赖关系最小化后:
请告知我是否应该从中排除一些JAR。可能有些可传递依赖项未使用,但没有自动确定的方法。您可以排除所有可传递的依赖项(使用excludes标记),生成/运行应用程序,并在出现错误时继续添加适当的依赖项。其中一些会导致编译失败,另一些会导致应用程序在运行时失败。
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<version>1.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core-tiger</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-acl</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc-struts</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>2.5.6</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.3.1.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.4.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.1.0.GA</version>
</dependency>
org.springframework.ws
SpringWS核心
1.5.6
org.springframework.ws
spring ws-security
1.5.6
org.springframework.security
spring安全内核
2.0.4
org.springframework.security
春季安全核心虎
2.0.4
org.springframework.security
spring安全acl
2.0.4
org.springframework.security
spring安全标记库
2.0.4
org.springframework
弹簧芯
2.5.6
org.springframework
spring上下文
2.5.6
org.springframework
春豆
2.5.6
org.springframework
春季aop
2.5.6
org.springframework
SpringJMS
2.5.6
org.springframework
SpringJDBC
2.5.6
org.springframework
弹簧网
2.5.6
org.springframework
SpringWebMVC struts
2.5.6
org.springframework
SpringWebMVC
2.5.6
org.springframework
德克萨斯州春季
2.5.6
org.springframework
春季甲虫
2.5.6
org.springframework
spring上下文支持
2.5.6
org.springframework
spring上下文
2.5.6
org.springframework
弹簧试验
2.5.6
javax.persistence
持久性api
1
org.hibernate
冬眠核心
3.3.1.GA
org.hibernate
休眠注释
3.4.0.GA
org.hibernate
休眠实体管理器
3.4.0.GA
org.hibernate
休眠验证器
3.1.0.GA
既然您使用的是Maven,为什么不只列出您的直接依赖项,让Maven为您下载可传递的依赖项呢?很抱歉,我对Maven不是很在行,请您再解释一下您的意思是什么?只需列出您的代码直接依赖的依赖项(可能是spring jdbc、spring orm),Maven将使用这些人工制品的POM来确定所需的其他人工制品(spring代码、spring上下文等)。它将自动下载它们并使它们在类路径中可用。@JB Nize