8288分类目录 8288分类目录 8288分类目录
  当前位置:海洋目录网 » 站长资讯 » 站长资讯 » 文章详细 订阅RssFeed

Spring Cloud Alibaba 项目工程准备

来源:本站原创 浏览:89次 时间:2022-01-30
创建工程

Spring Cloud 项目都是基于 Spring Boot 进行开发,并且都是使用 Maven 做项目管理工具。在实际开发中,我们一般都会创建一个依赖管理项目作为 Maven 的 Parent 项目使用,这样做可以极大的方便我们对 Jar 包版本的统一管理

POM
<?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>org.springframework.boot</groupId>        <artifactId>spring-boot-starter-parent</artifactId>        <version>2.1.6.RELEASE</version>        <relativePath/>     </parent>    <groupId>com.funtl</groupId>    <artifactId>hello-spring-cloud-alibaba</artifactId>    <version>0.0.1-SNAPSHOT</version>    <packaging>pom</packaging>    <url>http://www.funtl.com</url>    <modules>        <module>hello-spring-cloud-alibaba-dependencies</module>    </modules>    <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>    <licenses>        <license>            <name>Apache 2.0</name>            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>        </license>    </licenses>    <developers>        <developer>            <id>liwemin</id>            <name>Lusifer Lee</name>            <email>lee.lusifer@gmail.com</email>        </developer>    </developers>    <dependencyManagement>        <dependencies>            <dependency>                <groupId>com.funtl</groupId>                <artifactId>hello-spring-cloud-alibaba-dependencies</artifactId>                <version>${project.version}</version>                <type>pom</type>                <scope>import</scope>            </dependency>        </dependencies>    </dependencyManagement>    <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>
创建依赖管理项目POM
<?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>com.funtl</groupId>    <artifactId>hello-spring-cloud-alibaba-dependencies</artifactId>    <version>0.0.1-SNAPSHOT</version>    <packaging>pom</packaging>    <url>http://www.funtl.com</url>    <properties>        <spring-cloud.version>Greenwich.SR2</spring-cloud.version>        <spring-cloud-alibaba.verion>2.1.0.RELEASE</spring-cloud-alibaba.verion>    </properties>    <licenses>        <license>            <name>Apache 2.0</name>            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>        </license>    </licenses>    <developers>        <developer>            <id>liwemin</id>            <name>Lusifer Lee</name>            <email>lee.lusifer@gmail.com</email>        </developer>    </developers>    <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>com.alibaba.cloud</groupId>                <artifactId>spring-cloud-alibaba-dependencies</artifactId>                <version>${spring-cloud-alibaba.verion}</version>                <type>pom</type>                <scope>import</scope>            </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>


  推荐站点

  • At-lib分类目录At-lib分类目录

    At-lib网站分类目录汇集全国所有高质量网站,是中国权威的中文网站分类目录,给站长提供免费网址目录提交收录和推荐最新最全的优秀网站大全是名站导航之家

    www.at-lib.cn
  • 中国链接目录中国链接目录

    中国链接目录简称链接目录,是收录优秀网站和淘宝网店的网站分类目录,为您提供优质的网址导航服务,也是网店进行收录推广,站长免费推广网站、加快百度收录、增加友情链接和网站外链的平台。

    www.cnlink.org
  • 35目录网35目录网

    35目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向35目录推荐、提交优秀网站。

    www.35mulu.com
  • 就要爱网站目录就要爱网站目录

    就要爱网站目录,按主题和类别列出网站。所有提交的网站都经过人工审查,确保质量和无垃圾邮件的结果。

    www.912219.com
  • 伍佰目录伍佰目录

    伍佰网站目录免费收录各类优秀网站,全力打造互动式网站目录,提供网站分类目录检索,关键字搜索功能。欢迎您向伍佰目录推荐、提交优秀网站。

    www.wbwb.net