java Web分布式后台搭建(一) 构建maven项目

1. 待实现组件目录清单

  • 云平台(cloud-platform)
    • 公用bean组件(cloud-beans)
    • 公用util组件(cloud-utils)
    • 注册中心(cloud-discovery)
    • redis服务组件(redis-service)
    • mongo服务组件(mongo-service)
    • mysql服务组件(mysql-service)
    • 对外restful api组件(client-api)
    • 对内admin管理组件(admin-system)
    • 权限服务组件(authority-service)

2. cloud-platform项目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.0modelVersion>

    <groupId>com.china.wanggroupId>
    <artifactId>cloud-platformartifactId>
    <version>V1.0.1version>
    <packaging>pompackaging>
    <name>cloud-platformname>
    <description>云平台description>

    
    <modules>
        <module>cloud-beansmodule>
        <module>cloud-utilsmodule>
        <module>cloud-discoverymodule>
        <module>redis-servicemodule>
        <module>mongo-servicemodule>
        <module>client-apimodule>
        <module>admin-systemmodule>
        <module>authority-servicemodule>
        <module>mysql-servicemodule>
    modules>

    
    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>1.5.8.RELEASEversion>
    parent>

    <properties>
        
        <springfox-version>2.7.0springfox-version>
    properties>


    
    <dependencyManagement>
        <dependencies>
            
            <dependency>
                <groupId>org.springframework.cloudgroupId>
                <artifactId>spring-cloud-dependenciesartifactId>
                <version>Dalston.SR4version>
                <type>pomtype>
                <scope>importscope>
            dependency>

            
            <dependency>
                <groupId>org.springframework.cloudgroupId>
                <artifactId>spring-cloud-starter-eureka-serverartifactId>
            dependency>

            
            <dependency>
                <groupId>org.springframework.cloudgroupId>
                <artifactId>spring-cloud-starter-securityartifactId>
            dependency>

            
            <dependency>
                <groupId>org.springframework.cloudgroupId>
                <artifactId>spring-cloud-starter-feignartifactId>
            dependency>

            
            <dependency>
                <groupId>io.springfoxgroupId>
                <artifactId>springfox-swagger2artifactId>
                <version>${springfox-version}version>
            dependency>
            <dependency>
                <groupId>io.springfoxgroupId>
                <artifactId>springfox-swagger-uiartifactId>
                <version>${springfox-version}version>
            dependency>

        dependencies>

    dependencyManagement>


    <build>
        
        <pluginManagement>
            <plugins>
                
                <plugin>
                    <groupId>org.apache.maven.pluginsgroupId>
                    <artifactId>maven-compiler-pluginartifactId>
                    <configuration>
                        <source>1.8source>
                        <target>1.8target>
                    configuration>
                plugin>

                
                <plugin>
                    <groupId>org.apache.maven.pluginsgroupId>
                    <artifactId>maven-source-pluginartifactId>
                    <version>2.1.1version>
                    <executions>
                        <execution>
                            <id>attach-sourcesid>
                            <phase>packagephase>
                            <goals>
                                <goal>jar-no-forkgoal>
                            goals>
                        execution>
                    executions>
                plugin>

                
                <plugin>
                    <groupId>org.springframework.bootgroupId>
                    <artifactId>spring-boot-maven-pluginartifactId>
                    <configuration>
                        <jvmArguments>-Dfile.encoding=UTF-8jvmArguments>
                    configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackagegoal>
                            goals>
                        execution>
                    executions>
                plugin>
            plugins>
        pluginManagement>
    build>
project>

你可能感兴趣的:(spring-cloud)