大数据正式37

大数据正式37

Maven

  • 传统项目存在的弊端
    1. 导入jar包得经验丰富
    2. 传统项目打包方式不通用,不能很好的支持聚合项目的打包
    3. 传统项目文件(配置文件,核心代码,测试代码)都放到src下
  • Maven优点
    1. 可以通过几行简单的配置引入所需要的jar包,并且会同时引入第三方的jar包
    2. 支持聚合项目打包,而且操作简单
    3. 分目录存放各种文件

jar包寻迹

  • maven

    • pom

      <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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>cn.tedu.ht</groupId>
        <artifactId>ht</artifactId>
        <packaging>war</packaging>
        <version>0.0.1-SNAPSHOT</version>
        <name>ht Maven Webapp</name>
        <url>http://maven.apache.org</url>
      
      
        <!-- 集中定义依赖版本号 -->
          <properties>
              <junit.version>4.12</junit.version>
              <spring.version>4.2.3.RELEASE</spring.version>
      
              <mybatis.version>3.2.8</mybatis.version>
              <mybatis.spring.version>1.2.2</mybatis.spring.version>
              <mybatis.paginator.version>1.2.15</mybatis.paginator.version>
              <mysql.version>5.1.32</mysql.version>
              <bonecp-spring.version>0.8.0.RELEASE</bonecp-spring.version>
              <druid.version>1.0.9</druid.version>
      
              <mapper.version>2.3.2</mapper.version>
              <pagehelper.version>3.4.2</pagehelper.version>
              <jsqlparser.version>0.9.1</jsqlparser.version>
      
              <slf4j.version>1.6.4</slf4j.version>
              <jstl.version>1.2</jstl.version>
              <servlet-api.version>2.5</servlet-api.version>
              <jsp-api.version>2.0</jsp-api.version>
          </properties>
      
          <dependencies>
              <!-- Spring -->
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-context</artifactId>
                  <version>${spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.springframework</groupId>
                  <artifactId>spring-webmvc</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-aspects</artifactId>
                  <version>${spring.version}</version>
              </dependency>
      
              <!-- Mybatis -->
              <dependency>
                  <groupId>org.mybatis</groupId>
                  <artifactId>mybatis</artifactId>
                  <version>${mybatis.version}</version>
              </dependency>
              <dependency>
                  <groupId>org.mybatis</groupId>
                  <artifactId>mybatis-spring</artifactId>
                  <version>${mybatis.spring.version}</version>
              </dependency>
              <dependency>
                  <groupId>com.github.miemiedev</groupId>
                  <artifactId>mybatis-paginator</artifactId>
                  <version>${mybatis.paginator.version}</version>
              </dependency>   
      
              <!-- 通用Mapper,所有的单表的代码都不用编写 -->
              <dependency>
                  <groupId>com.github.abel533</groupId>
                  <artifactId>mapper</artifactId>
                  <version>${mapper.version}</version>
              </dependency>
      
              <!-- Oracle版权问题,maven目录必须自己手动建立 -->
              <dependency> 
                  <groupId>com.oracle</groupId>
                  <artifactId>ojdbc6</artifactId>
                  <version>11.1.0.7.0</version>
              </dependency>
      
              <!-- MySql -->
              <dependency>
                  <groupId>mysql</groupId>
                  <artifactId>mysql-connector-java</artifactId>
                  <version>${mysql.version}</version>
              </dependency>
              <!-- 超高性能连接池 -->
              <dependency>
                  <groupId>com.zaxxer</groupId>
                  <artifactId>HikariCP-java6</artifactId>
                  <version>2.3.9</version>
                  <scope>compile</scope>
              </dependency>   
      
              <!-- Apache Shiro 权限架构 -->
              <dependency>
                  <groupId>org.apache.shiro</groupId>
                  <artifactId>shiro-all</artifactId>
                  <version>1.2.3</version>
              </dependency>   
      
              <!-- 分页插件 -->
              <dependency>
                  <groupId>com.github.pagehelper</groupId>
                  <artifactId>pagehelper</artifactId>
                  <version>${pagehelper.version}</version>
              </dependency>
              <dependency>
                  <groupId>com.github.jsqlparser</groupId>
                  <artifactId>jsqlparser</artifactId>
                  <version>${jsqlparser.version}</version>
              </dependency>
      
              <dependency>
                  <groupId>org.slf4j</groupId>
                  <artifactId>slf4j-log4j12</artifactId>
                  <version>${slf4j.version}</version>
              </dependency>
      
              <!-- JSP相关 -->
              <dependency>
                  <groupId>jstl</groupId>
                  <artifactId>jstl</artifactId>
                  <version>${jstl.version}</version>
              </dependency>
              <dependency>
                  <groupId>javax.servlet</groupId>
                  <artifactId>servlet-api</artifactId>
                  <version>${servlet-api.version}</version>
                  <scope>provided</scope>
              </dependency>
              <dependency>
                  <groupId>javax.servlet</groupId>
                  <artifactId>jsp-api</artifactId>
                  <version>${jsp-api.version}</version>
                  <scope>provided</scope>
              </dependency>
      
              <!-- 字符加密、解密 -->
              <dependency>
                  <groupId>commons-codec</groupId>
                  <artifactId>commons-codec</artifactId>
                  <version>1.9</version>
              </dependency>
      
              <!-- 数据校验 -->
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-validator</artifactId>
                  <version>5.1.3.Final</version>
              </dependency>                       
          </dependencies>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.tomcat.maven</groupId>
                      <artifactId>tomcat7-maven-plugin</artifactId>
                      <version>2.2</version>
                      <configuration>
                          <port>8090</port>
                          <path>/</path>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      
      </project>
      

maven的java项目

maven的web项目

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

乘风御浪云帆之上

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值