标签:http mod 运行 dep void for 特殊 cti org
<?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>
</project>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/>
</parent>
这样当前的项目就是 Spring Boot 项目了。spring-boot-starter-parent 是一个特殊的 starter,它用来提供相关的 Maven 默认依赖。使用它之后,常用的包依赖可以省去 version 标签。
<groupId>com.zhang</groupId>
<artifactId>project01</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>project01</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
application.properties
@SpringBootApplication
public class Project01Application {
public static void main(String[] args) {
SpringApplication.run(Project01Application.class, args);
}
}
mvn spring-boot:run
mvn package
java -jar XXXX
标签:http mod 运行 dep void for 特殊 cti org
原文地址:https://www.cnblogs.com/zhangliuping/p/12064113.html