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)

posted @ 2017-07-10 16:01  hjzqyx  阅读(5744)  评论(1编辑  收藏  举报