springcloud 父项目建立(一)


我们开发项目,现在基本都用到maven,以及用父子项目,以及公共模块依赖,来构建方便扩展的项目体系;
首先我们建立父项目 microservice ,主要是一个pom,管理module,以及管理依赖,规范所有jar包版本等;

新建maven项目

 勾选 create a simple project

 填写groud ip   , artifact Id ,  Packaging 指定成pom 

 

我们Springcloud版本 用 Edgware.SR4
Springboot版本 用 1.5.13.RELEASE

修改pom.xml

<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.java1234.springcloud</groupId>
  <artifactId>microservice</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
   
  <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <druid.version>1.1.10</druid.version>
  </properties>
   
  <dependencyManagement>
      <dependencies>
          <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Edgware.SR4</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>1.5.13.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- 连接池 -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>${druid.version}</version>
        </dependency>
      </dependencies>
  </dependencyManagement>
</project>


这里引入了 springcloud 以及springboot  包括 druid连接池  以及 属性 规范编译 目标版本,包括连接池版本 编码等信息;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值