• dubbo配置文件


    项目

    <?xml version="1.0" encoding="UTF-8"?>
    <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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.1.6.RELEASE</version>
            <relativePath/> <!-- lookup parent from repository -->
        </parent>
        <groupId>pers.yuriy</groupId>
        <artifactId>dubbo</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>pom</packaging>
    
    
        <properties>
            <java.version>1.8</java.version>
            <maven.compiler.source>${java.version}</maven.compiler.source>
            <maven.compiler.target>${java.version}</maven.compiler.target>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        </properties>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>pers.yuriy</groupId>
                    <artifactId>dubbo-dependencies</artifactId>
                    <version>${project.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
    
        <modules>
            <module>dubbo-denpendencies</module>
            <module>dubbo-provider</module>
            <module>dubbo-consumer</module>
        </modules>
        <profiles>
            <profile>
                <id>default</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <properties>
                    <spring-javaformat.version>0.0.12</spring-javaformat.version>
                </properties>
                <build>
                    <plugins>
                        <plugin>
                            <groupId>io.spring.javaformat</groupId>
                            <artifactId>spring-javaformat-maven-plugin</artifactId>
                            <version>${spring-javaformat.version}</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <includes>
                                    <include>**/*Tests.java</include>
                                </includes>
                                <excludes>
                                    <exclude>**/Abstract*.java</exclude>
                                </excludes>
                                <systemPropertyVariables>
                                    <java.security.egd>file:/dev/./urandom</java.security.egd>
                                    <java.awt.headless>true</java.awt.headless>
                                </systemPropertyVariables>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-enforcer-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>enforce-rules</id>
                                    <goals>
                                        <goal>enforce</goal>
                                    </goals>
                                    <configuration>
                                        <rules>
                                            <bannedDependencies>
                                                <excludes>
                                                    <exclude>commons-logging:*:*</exclude>
                                                </excludes>
                                                <searchTransitive>true</searchTransitive>
                                            </bannedDependencies>
                                        </rules>
                                        <fail>true</fail>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-install-plugin</artifactId>
                            <configuration>
                                <skip>true</skip>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <skip>true</skip>
                            </configuration>
                            <inherited>true</inherited>
                        </plugin>
                    </plugins>
                </build>
            </profile>
        </profiles>
    
        <repositories>
            <repository>
                <id>spring-milestone</id>
                <name>Spring Milestone</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>spring-snapshot</id>
                <name>Spring Snapshot</name>
                <url>https://repo.spring.io/snapshot</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
    
        <pluginRepositories>
            <pluginRepository>
                <id>spring-milestone</id>
                <name>Spring Milestone</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
            <pluginRepository>
                <id>spring-snapshot</id>
                <name>Spring Snapshot</name>
                <url>https://repo.spring.io/snapshot</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </project>
    
    

    依赖管理

    <?xml version="1.0" encoding="UTF-8"?>
    <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>pers.yuriy</groupId>
        <artifactId>dubbo-dependencies</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>pom</packaging>
    
        <properties>
            <dubbo.version>2.7.2</dubbo.version>
            <dubbo-kryo.version>2.7.2</dubbo-kryo.version>
            <dubbo-actuator.version>2.7.1</dubbo-actuator.version>
            <spring-cloud.version>Greenwich.RELEASE</spring-cloud.version>
            <spring-cloud-alibaba.verion>0.9.0.RELEASE</spring-cloud-alibaba.verion>
            <alibaba-spring-context-support.version>1.0.2</alibaba-spring-context-support.version>
        </properties>
    
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-dependencies</artifactId>
                    <version>${spring-cloud.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
                <dependency>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                    <version>${spring-cloud-alibaba.verion}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.dubbo</groupId>
                    <artifactId>dubbo</artifactId>
                    <version>${dubbo.version}</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.springframework</groupId>
                            <artifactId>spring</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>javax.servlet</groupId>
                            <artifactId>servlet-api</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>log4j</groupId>
                            <artifactId>log4j</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
                <dependency>
                    <groupId>org.apache.dubbo</groupId>
                    <artifactId>dubbo-spring-boot-actuator</artifactId>
                    <version>${dubbo-actuator.version}</version>
                </dependency>
                <dependency>
                    <groupId>com.alibaba.spring</groupId>
                    <artifactId>spring-context-support</artifactId>
                    <version>${alibaba-spring-context-support.version}</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.dubbo</groupId>
                    <artifactId>dubbo-serialization-kryo</artifactId>
                    <version>${dubbo-kryo.version}</version>
                </dependency>
            </dependencies>
        </dependencyManagement>
        <repositories>
            <repository>
                <id>spring-milestone</id>
                <name>Spring Milestone</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>spring-snapshot</id>
                <name>Spring Snapshot</name>
                <url>https://repo.spring.io/snapshot</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>spring-milestone</id>
                <name>Spring Milestone</name>
                <url>https://repo.spring.io/milestone</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
            <pluginRepository>
                <id>spring-snapshot</id>
                <name>Spring Snapshot</name>
                <url>https://repo.spring.io/snapshot</url>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </project>
    

    provider

    api

    <?xml version="1.0" encoding="UTF-8"?>
    <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>
        <parent>
            <groupId>pers.yuriy</groupId>
            <artifactId>dubbo-provider</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </parent>
        <artifactId>dubbo-provider-api</artifactId>
        <packaging>jar</packaging>
    </project>
    

    service

    <?xml version="1.0" encoding="UTF-8"?>
    <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>
        <parent>
            <groupId>pers.yuriy</groupId>
            <artifactId>dubbo-provider</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </parent>
        <artifactId>dubbo-provider-service</artifactId>
        <packaging>jar</packaging>
    
        <dependencies>
            <!-- Spring Boot Begin -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <!-- Spring Boot End -->
            <!-- Apache Dubbo Begin -->
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-spring-boot-starter</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>dubbo-registry-nacos</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba.spring</groupId>
                <artifactId>spring-context-support</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-serialization-kryo</artifactId>
            </dependency>
            <!-- Apache Dubbo End -->
            <!-- Projects Begin -->
            <dependency>
                <groupId>pers.yuriy</groupId>
                <artifactId>dubbo-provider-api</artifactId>
                <version>${project.parent.version}</version>
            </dependency>
            <!-- Projects End -->
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>pers.yuriy.dubbo.provider.ProviderApplication</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    

    consumer

    <?xml version="1.0" encoding="UTF-8"?>
    <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>
        <parent>
            <groupId>pers.yuriy</groupId>
            <artifactId>dubbo</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </parent>
        <artifactId>dubbo-consumer</artifactId>
        <packaging>jar</packaging>
    
        <dependencies>
            <!-- Spring Boot Begin -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <scope>test</scope>
            </dependency>
            <!-- Spring Boot End -->
            <!-- Apache Dubbo Begin -->
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-spring-boot-starter</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-spring-boot-actuator</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>dubbo-registry-nacos</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
            </dependency>
            <dependency>
                <groupId>com.alibaba.spring</groupId>
                <artifactId>spring-context-support</artifactId>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-serialization-kryo</artifactId>
            </dependency>
            <!-- Apache Dubbo End -->
            <!-- Projects Begin -->
            <dependency>
                <groupId>pers.yuriy</groupId>
                <artifactId>dubbo-provider-api</artifactId>
                <version>${project.parent.version}</version>
            </dependency>
            <!-- Projects End -->
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <mainClass>pers.yuriy.dubbo.consumer.ConsumerApplication</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    
  • 相关阅读:
    0414结对 复利
    0619-学习进度条
    测试
    冲刺一总结
    实验四主存空间的分配和回收
    0622-软件工程学期总结
    学术诚信与职业道德有感
    《构建之法》第8、9、10章
    0512 操作系统进程调度实验
    构建之法 第6~7章读后感和对Scrum的理解
  • 原文地址:https://www.cnblogs.com/zhouyu0-0/p/12054007.html
Copyright © 2020-2023  润新知