zoukankan      html  css  js  c++  java
  • springboot工程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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.hjzgg.simulation</groupId>
        <artifactId>service</artifactId>
        <version>1.0-SNAPSHOT</version>
    
        <modules>
            <module>provider</module>
            <module>consumer</module>
            <module>register</module>
            <module>common</module>
            <module>api</module>
        </modules>
        <packaging>pom</packaging>
    
        <name>service</name>
        <url>http://maven.apache.org</url>
      
      //这里让 spring boot parent 当做项目的 parent <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>${spring-boot.version}</version> </parent> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> <common.lang3.version>3.4</common.lang3.version> <pagehelper.version>4.1.1</pagehelper.version> <fastjson.version>1.2.17</fastjson.version> <swagger2-version>2.6.1</swagger2-version> <spring-boot.version>1.5.2.RELEASE</spring-boot.version> </properties> <dependencyManagement> <dependencies> <!-- 公共组件 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${common.lang3.version}</version> </dependency> <!--fast json--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <!--swagger2--> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>${swagger2-version}</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>${swagger2-version}</version> </dependency>         
            //这里,是另一种依赖 spring boot方式
    <!--<dependency>--> <!--<groupId>org.springframework.boot</groupId>--> <!--<artifactId>spring-boot-dependencies</artifactId>--> <!--<version>${spring-boot.version}</version>--> <!--<type>pom</type>--> <!--<scope>import</scope>--> <!--</dependency>--> </dependencies> </dependencyManagement> </project>

    参考:spring-boot-dependencies

    参考示例工程1  参考示例工程2(maven多module情况下使用springboot)

  • 相关阅读:
    微信点餐系统(六)-买家端订单(上)
    微信点餐系统(五)-买家端商品
    微信点餐系统(四)-买家端类目
    微信点餐系统(三)-开发环境配置
    微信点餐系统(二)-项目设计
    微信点餐系统(一)-系统简介
    spring学习(02)之配置文件没有提示问题
    spring学习(01)之IOC
    struts2 中的 addActionError 、addFieldError、addActionMessage的方法【转】
    在一个JSP页面中包含另一个JSP页面的三种方式
  • 原文地址:https://www.cnblogs.com/hujunzheng/p/7146274.html
Copyright © 2011-2022 走看看