社区idea 手动maven 创建springboot项目
创建之后修改pom.xml
xml
<?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.student</groupId>
<artifactId>Maven-SpringBoot</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Maven-SpringBoot</name>
<!--1.spring-boot-starter-parent自动引入springboot中最基础的组件,所有springboot项目都要依赖它进行构建-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!--2.引入springboot依赖,spring-boot-starter-web表示在项目中增加支持javaweb的功能,版本信息已经在parent中定义-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<!--3.定义springboot的打包方式,spring-boot-maven-plugin可以在打包时自动将所有类和资源打包成一个独立可运行的jar包-->
<build>
<!--打包指定名称-->
<finalName>mevanSpringBoot</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
版本号可以修改,刷新之后创建启动类:SpringBootApplicationMevan
java
package com.student;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* Hello world!
*
*/
@SpringBootApplication
public class SpringBootApplicationMevan {
public static void main( String[] args )
{
System.out.println( "Hello World!" );
SpringApplication.run(SpringBootApplicationMevan.class, args);
}
}