通过maven创建springboot项目
Posted dongbo
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过maven创建springboot项目相关的知识,希望对你有一定的参考价值。
1,idea选择创建一个maven项目
2,pom.xml
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> </dependency> <!-- devtools --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> </dependencies> <!-- 必须要有repackage,否则package报错 --> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <!-- 版本管理 --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.2.2.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <!-- 如果需要deploy到nexus,则需要配置此标签 --> <distributionManagement> <repository> <id>nexus-releases</id> <name>Nexus Release Repository</name> <url>http://localhost:8081/repository/maven-releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>Nexus Snapshot Repository</name> <url>http://localhost:8081/repository/maven-snapshots/</url> </snapshotRepository> </distributionManagement>
以上是关于通过maven创建springboot项目的主要内容,如果未能解决你的问题,请参考以下文章