maven的构建

一、
    comlile:编译,把java问价编译成class文件
    test:测试,不会打包跟部署,执行test里的方法
    package:打包,
    install:安装到本地,生成war包
    deploy:部署,将项目部署到服务器上


二、maven的构建
    ①application-parent   (父)  pom类型

       <modelVersion>4.0.0</modelVersion>
  <groupId>huox.xin</groupId>
  <artifactId>application-parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  
  
    
  <modules>
  
    <module>../application-util</module>
    <module>../application-dao</module>
    <module>../application-service</module>
    <module>../application-web</module>
  
  </modules>
  

  

    ②application-util         (继承parent)  jar类型    model-vo-util  一般所需jar包pom.xml文件junit,servlet-api,spring-mvc

       <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>huox.xin</groupId>
    <artifactId>application-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <relativePath>../application-parent/pom.xml</relativePath>
  </parent>

  <artifactId>application-util</artifactId>

<dependencies>


    ③application-dao        (继承parent)  jar类型    dao            一般所需jar包 pom.xml文件mybatis,mybatis-generator-core,c3p0,pagehelper,mysql-connector-java

   <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>huox.xin</groupId>
    <artifactId>application-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
     <relativePath>../application-parent/pom.xml</relativePath>
  </parent>
  <artifactId>application-dao</artifactId>
  
  
  
  <dependencies>
  
      <dependency>
           <groupId>huox.xin</groupId>
    <artifactId>application-util</artifactId>
    <version>0.0.1-SNAPSHOT</version>
      </dependency>
  

    ④application-service    (继承parent) jar类型    service-impl-resource配置文件-test    一般所需jar包junit,spring-aspects,spring-jdbc,spring-webmvc,mybatis-spring,servlet-api

   <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>huox.xin</groupId>
    <artifactId>application-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <relativePath>../application-parent/pom.xml</relativePath>
  </parent>
  
  <artifactId>application-service</artifactId>
  
  <dependencies>
      
      <dependency>
          <groupId>huox.xin</groupId>
    <artifactId>application-dao</artifactId>
    <version>0.0.1-SNAPSHOT</version>
      </dependency>
      


    ⑤application-web        (继承parent) war类型    action-interceptor-WEB-ROOT下的文件(包括静态文件跟一些jsp等等)  一般所需jar包servlet-api,connons-fileupload,jstl,hibernate-validator,jackson-databind,commons-io,commons-logging,ezmorph,commons-lang,commons-collections,commons-beanutils,jaon-lib2.4,

       <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>huox.xin</groupId>
    <artifactId>application-parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
     <relativePath>../application-parent/pom.xml</relativePath>
  </parent>
  <artifactId>application-web</artifactId>
  <packaging>war</packaging>
  <dependency>
      <groupId>huox.xin</groupId>
    <artifactId>application-service</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </dependency>

    这些一层依赖一层

    每个子项目中要有<relativepath>../application-parent/pom.xml</relativepath>


























  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值