You can save a lot of time by summarizing the Maven dependencies that are commonly used in your development process without having to go to the Maven repository every time.
– pom. XML template
<? The 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 > < the parent > < groupId > org. Springframework. Boot < / groupId > The < artifactId > spring - the boot - starter - parent < / artifactId > < version > 2.5.1 < / version > < relativePath / > < / parent > <groupId>com.daoge.seata</groupId> <artifactId>spring-boot-samples</artifactId> <name>spring-boot-samples</name> <version> 0.0.1-snapshot </version> </packaging> <description>Demo project for Spring Boot</description> </packaging> pom</packaging> </description> Demo project for Spring Boot</description> . < the properties > < Java version > 1.8 < / Java version > < maven - deploy - plugin. Version > 3.0.0 - M1 < / maven - deploy - plugin. Version > < maven - compiler - the plugin version > 3.8.1 < / maven - compiler - plugin. Version > < springboot. Verizon > 2.5.1 < / springboot. Verizon > </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <version>${springboot.verison}</version> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>${maven-deploy-plugin.version}</version> <configuration> <skip>true</skip> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${maven-compiler-plugin.version}</version> <configuration> <source>${java.version}</source> <target>${java.version}</target> </configuration> </plugin> </plugins> </build> </project>
– springboot
<properties> < SpringBoot. Verison > </properties> < Dependencies > <! --spring-boot--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> <version>${springboot.verison}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>${springboot.verison}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${springboot.verison}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>${springboot.verison}</version> </dependency> </dependencies>
– db
< the properties > < the mysql - version > 5.1.49 < / mysql - the version > < druid. Version > 1.2.6 < / druid version > < mybatis version > 2.2.0 < / mybatis version > < mybatis - plus. Version > rule 3.4.3 < / mybatis - plus. Version > </tk-mybatis version> <lombok. Version >1.18.20</lombok. Version > </properties> < Dependencies > <! --db--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql-connector.version}</version> </dependency> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid.version}</version> </dependency> <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>${mybatis.version}</version> </dependency> <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus</artifactId> <version>${mybatis-plus.version}</version> </dependency> <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>${tk-mybatis.version}</version> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> </dependency> </dependencies>
– nacos
< the properties > < nacos. Version > 0.2.3 < / nacos version > < nacos - client. Verizon > 1.1.3 < / nacos - client. Verizon > < / properties > <dependencies> <! --nacos client--> <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> <version>${nacos-client.verison}</version> </dependency> </dependencies>
– dubbo
<properties> <apache.dubbo.version>3.0.0</apache.dubbo.version> </properties> <dependencies> <! --dubbo--> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-spring-boot-starter</artifactId> <version>${apache.dubbo.version}</version> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo</artifactId> <version>${apache.dubbo.version}</version> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-registry-nacos</artifactId> <version>${apache.dubbo.version}</version> </dependency> </dependencies>
– seata
< the properties > < seata - spring - the boot - starter. Version > 1.4.2 < / seata - spring - the boot - starter. Version > < seata - all version > 1.4.2 < / seata. -all version > < / properties > < dependencies > <! -- seata --> <dependency> <groupId>io.seata</groupId> <artifactId>seata-spring-boot-starter</artifactId> <version>${seata-spring-boot-starter.version}</version> <exclusions> <exclusion> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>io.seata</groupId> <artifactId>seata-all</artifactId> <version>${seata-all.version}</version> </dependency> </dependencies>
– netty
Final</ netty-all-version > </properties> < Dependencies > <! --netty--> <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>${netty-all.version}</version> </dependency> </dependencies>
– utils
< properties > < apache. Httpclient. Version > 4.5 < / apache. Httpclient. Version > < alibaba. Spring - the context - support. Version > 1.0.11 < / alibaba. Spring - the context - support. Version > < fastjson version > 1.2.47 < / fastjson version > < Commons - lang3. Version > 3.9 < / Commons - lang3. Version > < guava version > 27.0.1 - jre < / guava. Version > < / properties > < dependencies > <! --httpclient--> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>${apache.httpclient.version}</version> </dependency> <! > <dependency> < grouppid >com.alibaba. Spring </ grouppid > <artifactId>spring-context-support</artifactId> <version>${alibaba.spring-context-support.version}</version> </dependency> <! -- fastjson --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <! -- commons-lang3 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons-lang3.version}</version> </dependency> <! -- guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>${guava.version}</version> </dependency> </dependencies>
WeChat official account – Redcode1024 blogger, engaged in program development for more than 10 years, sharing useful industry solutions, welcome to leave comments and exchange.