2.基础环境搭建
来源:互联网 发布:男士去黑眼圈知乎 编辑:程序博客网 时间:2024/05/20 23:32
关于maven的一篇很好的博文:http://www.cnblogs.com/hongwz/p/5456578.html
1.新建一个maven project
因为这是一个JavaWeb程序,所以Packaging是war。
2.配置maven的mirror和profile
<mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>central</mirrorOf> </mirror>
<profile> <id>jdk17</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.7</jdk> </activation> <proporties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion> </proporties> </profile>
3.引入项目依赖jar包
maven仓库:https://mvnrepository.com/
注:()里是maven仓库搜索jar的名称
- SpringMVC (spring webmvc)
- Spring JDBC(Spring jdbc)
- Spring面向对象编程(Spring aspects)
- Mybatis(mybatis)
- mybatis整合Spring的适配包(mybatis Spring)
- 数据库连接池(c3p0)
- MySQL驱动(mysql)
- jstl(jstl)
- servletAPI(servletAPI)
- 单元测试(Junit)
4.引入bootstrap框架
bootstrap官网:http://v3.bootcss.com/getting-started/
- 在webapp下建一个文件夹(我建的是static,名字随便起)用来存放bootstrap文件。
- 在前端jsp页面引入bootstrap的样式和脚本
<!-- Bootstrap样式 --> <link href="static/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet"><!-- bootstrap的脚本 --> <script src="static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
3.引入jQuery文件:
<!-- jQuery --> <script type="text/javascript" herf="static/js/jquery-3.1.1.min.js"></script>
5.pom.xml代码:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.lee</groupId> <artifactId>crud</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.3.7.RELEASE</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc --><dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>4.3.7.RELEASE</version></dependency> <!-- https://mvnrepository.com/artifact/org.springframework/spring-aspects --><dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>4.3.7.RELEASE</version></dependency> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --><dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.1</version></dependency> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring --><dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.0</version></dependency> <!-- https://mvnrepository.com/artifact/c3p0/c3p0 --><dependency> <groupId>c3p0</groupId> <artifactId>c3p0</artifactId> <version>0.9.1.2</version></dependency> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --><dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>6.0.6</version></dependency> <!-- https://mvnrepository.com/artifact/jstl/jstl --><dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.2</version></dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --><dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> <scope>provided</scope></dependency> <!-- https://mvnrepository.com/artifact/junit/junit --><dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope></dependency> </dependencies></project>
阅读全文
0 0
- 2.基础环境搭建
- JSP基础环境搭建
- LAMP基础环境搭建
- Struts2基础环境搭建
- Ubuntu 基础环境搭建
- PHP环境搭建基础
- 【Python】【基础】环境搭建
- linux基础环境搭建
- Ember基础环境搭建
- spring基础环境搭建
- 基础环境搭建
- angular2基础环境搭建
- ionic2-基础环境搭建
- springboot基础环境搭建
- 基础环境搭建
- Docker01_基础环境搭建
- android基础(开发环境搭建)
- 【01】Java基础+环境搭建
- 写接口时,对数据进行验证
- HTMLCSS前端效果汇总
- 运行jar包
- mysql相关整理
- Java动态代理机制详解(JDK 和CGLIB,Javassist,ASM)
- 2.基础环境搭建
- 完美世界2017/9/26笔试题
- 35 个 Java 代码性能优化总结
- linux相关整理
- 使用@PathVariable注解实现动态传值
- Android优化之切换Fragment
- python 中常用的画图工具
- B树、B-树、B+树、B*树
- Java 异常输出后之前语句才输出的原因是什么?