Introduction to pom.xml before starting the project
1. Introduction to idea maven packaging button
<properties> <java.version>2.5.2</java.version> <!--Skip test class packaging--> <skipTests>true</skipTests> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring-boot.version>2.5.2</spring-boot.version> </properties>
4.Maven packaging does not generate the target directory
5. The function of parenta tag
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.2</version> </parent>
6. <dependency> tag
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
7. Test project packaging
package com.jt.springboot_demo1;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class SpringbootDemo1ApplicationTests {
@Test
void contextLoads() {
}
}
8. <build> tag
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.5.2</version> <configuration> <mainClass>com.jt.springboot_demo1.SpringbootDemo1Application</mainClass> </configuration> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build>