使用eclipse 创建gradle 项目Springmvc+Spring+hibernate

最近在一次新的Android项目中又一次的使用到了JavaWeb来搭建项目的服务器端,时间间隔太久有一些细节记得不太清晰导致在搭建的过程中走了很过弯路,浪费了很多不必要的时间因此创建这个笔记来记录搭建的流程;
使用到工具eclipse、Tomact、Spring4.3.6、hibernate5、gradle等
 
一、使用eclipse创建gradle项目
在eclipse中点击file创建新项目具体创建过程看如下图示:
 
图1-1:选择other
 
图1-2:选择gradle project
 
图1-3
 
图1-4:项目取名
点击finish完成项目创建
 
二、修改项目为web项目
点中项目名称右击,选中properties出现如下界面
 
图2-1:这些作用是创建web项目为项目做些配置
 
图2-2:
 
图2-3:这个界面非常重要
 
图2-4:完成这个界面的选择配置后点击OK点击Apply 这里写错了应该将值修改为 src/weapp
 
三、jar包依赖
完成上述配置后,下一步我们添加项目所需要的jar包依赖
 
图3-1:点击build gradle在其中添加依赖
具体内容如下:
compile group: 'antlr', name: 'antlr', version: '2.7.7'
compile group: 'aopalliance', name: 'aopalliance', version: '1.0'
compile group: 'org.aspectj', name: 'aspectjrt', version: '1.8.5'
compile group: 'com.mchange', name: 'c3p0', version: '0.9.2.1'
compile group: 'com.fasterxml', name: 'classmate', version: '1.1.0'
compile group: 'classworlds', name: 'classworlds', version: '1.1'
compile group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.5'
 
compile group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.2'
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.1'
compile group: 'commons-dbcp', name: 'commons-dbcp', version: '1.4'
compile group: 'commons-digester', name: 'commons-digester', version: '2.1'
compile group: 'commons-fileupload', name: 'commons-fileupload', version: '1.3.2'
compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile group: 'commons-lang', name: 'commons-lang', version: '2.4'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
compile group: 'commons-logging', name: 'commons-logging', version: '1.1.3'
compile group: 'commons-pool', name: 'commons-pool', version: '1.6'
 
compile group: 'dom4j', name: 'dom4j', version: '1.6.1'
compile group: 'dwr', name: 'dwr', version: '1.1.1'
compile group: 'net.sf.ehcache', name: 'ehcache', version: '2.10.1'
compile group: 'net.sf.ezmorph', name: 'ezmorph', version: '1.0.6'
compile group: 'org.freemarker', name: 'freemarker', version: '2.3.23'
 
//hibernate
compile group: 'org.hibernate', name: 'hibernate-c3p0', version: '5.1.4.Final'
compile group: 'org.hibernate.common', name: 'hibernate-commons-annotations', version: '5.0.1.Final'
compile group: 'org.hibernate', name: 'hibernate-core', version: '5.1.4.Final'
compile group: 'org.hibernate', name: 'hibernate-ehcache', version: '5.1.4.Final'
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.1.4.Final'
compile group: 'org.hibernate', name: 'hibernate-envers', version: '5.1.4.Final'
compile group: 'org.hibernate', name: 'hibernate-java8', version: '5.1.4.Final'
compile group: 'org.hibernate.javax.persistence', name: 'hibernate-jpa-2.1-api', version: '1.0.0.Final'
compile group: 'org.hibernate', name: 'hibernate-jpamodelgen', version: '5.1.4.Final'
compile group: 'org.hibernate', name: 'hibernate-proxool', version: '5.1.4.Final'
 
compile group: 'org.infinispan', name: 'infinispan-commons', version: '8.2.5.Final'
compile group: 'org.infinispan', name: 'infinispan-core', version: '8.2.5.Final'
 
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.6.0'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.6.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.6.1'
 
compile group: 'org.jboss', name: 'jandex', version: '2.0.3.Final'
compile group: 'org.javassist', name: 'javassist', version: '3.22.0-GA'
 
compile group: 'org.jboss.logging', name: 'jboss-logging', version: '3.3.0.Final'
compile group: 'org.jboss.marshalling', name: 'jboss-marshalling-osgi', version: '1.4.10.Final'
compile group: 'org.jboss.spec.javax.transaction', name: 'jboss-transaction-api_1.1_spec', version: '1.0.1.Final'
 
//kanyixia
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.3'
 
compile group: 'javax.servlet.jsp.jstl', name: 'jstl', version: '1.2'
compile group: 'com.vividsolutions', name: 'jts', version: '1.13'
compile group: 'log4j', name: 'log4j', version: '1.2.16'
compile group: 'org.slf4j', name: 'log4j-over-slf4j', version: '1.6.1'
testCompile group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.7'
compile group: 'ch.qos.logback', name: 'logback-core', version: '1.0.7'
compile group: 'com.mchange', name: 'mchange-commons-java', version: '0.2.3.4'
compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.27'
compile group: 'proxool', name: 'proxool', version: '0.8.3'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.6.1'
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.6.1'
testCompile group: 'org.slf4j', name: 'slf4j-nop', version: '1.6.1'
 
//spring
compile group: 'org.springframework', name: 'spring-aop', version: '4.3.6.RELEASE'
compile group: 'org.springframework', name: 'spring-aspects', version: '4.3.6.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '4.3.6.RELEASE
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Spring MVC、Spring 3和Hibernate 4是常用的Java开发框架和库。你可以通过以下步骤来下载它们的jar包。 1. Spring MVC的jar包下载: 你可以在Spring官方网站(https://spring.io/)的"Projects"部分找到Spring MVC的相关信息和下载链接。在该页面上,你可以找到最新版本的Spring MVC并下载与之对应的jar包。 2. Spring 3的jar包下载: 同样,你可以在Spring官方网站上找到Spring 3的相关信息和下载链接。在该网站上,你可以找到Spring 3的最新版本并下载相应的jar包。 3. Hibernate 4的jar包下载: 你可以在Hibernate官方网站(https://hibernate.org)的"Downloads"部分找到Hibernate 4的相关信息和下载链接。在该页面上,你可以找到最新版本的Hibernate 4并下载对应的jar包。 无论是Spring MVC、Spring 3还是Hibernate 4,你可以选择下载官方提供的jar包来开始你的项目,也可以通过maven等构建工具来管理它们的依赖关系。在将这些jar包添加到你的项目中时,你应该将它们添加到你的构建路径下,并在项目配置文件中配置相应的引用和依赖。 希望以上的回答能够对你有所帮助! ### 回答2: 要下载Spring MVC,Spring 3以及Hibernate 4的jar包,有以下几种方法可供选择: 方法一:通过官方网站下载 你可以直接访问Spring官方网站(https://spring.io/)和Hibernate官方网站(https://hibernate.org/orm/)的下载页面,在这些页面上你可以找到相关的jar包。Spring官方网站提供了关于Spring MVC和Spring 3的jar包下载链接,Hibernate官方网站提供了关于Hibernate 4的jar包下载链接。 方法二:使用Maven依赖管理工具 如果你使用Maven作为项目构建工具,可以在项目的pom.xml文件中添加相关依赖,然后使用Maven自动下载这些jar包。在pom.xml文件中,你需要添加Spring MVC、Spring 3和Hibernate 4的相应依赖配置,然后运行Maven命令执行依赖下载。 方法三:使用Gradle依赖管理工具 如果你使用Gradle作为项目构建工具,可以在项目的build.gradle文件中添加相关依赖,然后使用Gradle自动下载这些jar包。在build.gradle文件中,你需要添加Spring MVC、Spring 3和Hibernate 4的相应依赖配置,然后运行Gradle命令执行依赖下载。 总之,你可以通过访问官方网站下载jar包,也可以使用Maven或Gradle工具自动下载。无论选择哪种方法,确保下载的jar包版本与你的项目要求的版本匹配,以确保项目能够正常运行。 ### 回答3: 可以在官方网站和第三方资源库下载Spring MVC、Spring 3和Hibernate 4的JAR包。以下是一些常用的下载渠道: 1. 官方网站下载:可以通过Spring官方网站(https://spring.io/projects/spring-framework)下载Spring MVC和Spring 3的JAR包。在网站上找到相应的版本并下载相关的JAR文件。 2. Maven下载:如果你使用Maven项目管理工具,你可以在pom.xml文件中添加相应的依赖关系,然后Maven会自动下载所需的JAR包。例如,你可以添加以下依赖项以下载Spring MVC、Spring 3和Hibernate 4的JAR包: ```xml <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>RELEASE</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>4.3.11.Final</version> </dependency> ``` 然后,执行Maven的更新命令以下载所需的依赖项。 3. 第三方资源库下载:除了官方网站外,还可以通过其他资源库如Apache Maven仓库(https://mvnrepository.com/)或JCenter(https://bintray.com/bintray/jcenter)下载Spring MVC、Spring 3和Hibernate 4的JAR包。在这些资源库的网站上搜索所需的JAR包,然后下载适合你的版本。 无论你选择哪种方式,下载所需的JAR包后,你可以将它们添加到你的项目构建路径中,以便在开发过程中使用Spring MVC、Spring 3和Hibernate 4的功能。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值