前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >springboot 非parent方式搭建

springboot 非parent方式搭建

作者头像
潇洒
发布2019-07-03 11:05:34
1.5K0
发布2019-07-03 11:05:34
举报
文章被收录于专栏:石头岛

非parent 方式 推荐使用这种方式。 这样就可以使子项目使用 parent 标签了。 这种方式需要两次步骤: 1.paretn 项目配置 2.子项目配置

  1. parent 项目配置添加一个 spring boot 依赖 <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>1.5.1.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>

type 是 pom,scope 是 import,这种类型的 dependency 只能在 dependencyManagement 标签中声明。 2.子项目配置 parent 就可以使用普通的父项目了,而只需要进行 spring boot 的普通依赖即可。

代码语言:javascript
复制
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
		        <version>1.5.1.RELEASE</version>
        </plugin>
    </plugins>
</build>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2017-10-17,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档