Maven 依赖搜索
记住:
junit scope → test
与servlet 有关的 scope → provided
maven打包webapp下资源不存在
| <build> |
| <resources> |
| <resource> |
| <directory>src/main/webapp</directory> |
| <targetPath>META-INF/resources</targetPath> |
| <includes> |
| <include>**/**</include> |
| </includes> |
| </resource> |
| </resources> |
| </build> |
资源插件
| <build> |
| <resources> |
| <resource> |
| <directory>src/main/java</directory> |
| <includes> |
| <include>**/*.properties</include> |
| <include>**/*.xml</include> |
| </includes> |
| |
| <filtering>false</filtering> |
| </resource> |
| </resources> |
| </build> |
| <build> |
| <resources> |
| <resource> |
| <directory>src/main/java</directory> |
| <includes> |
| <include>**/*.properties</include> |
| <include>**/*.xml</include> |
| </includes> |
| </resource> |
| |
| <resource> |
| <directory>src/main/resources</directory> |
| <includes> |
| <include>**/*.properties</include> |
| <include>**/*.xml</include> |
| </includes> |
| </resource> |
| |
| </resources> |
| </build> |
junit
| |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <version>4.12</version> |
| <scope>test</scope> |
| </dependency> |
| |
| |
| |
| @BeforeClass – 表示在类中的任意public static void方法执行之前执行 |
| @AfterClass – 表示在类中的任意public static void方法执行之后执行 |
| @Before – 表示在任意使用@Test注解标注的public void方法执行之前执行 |
| @After – 表示在任意使用@Test注解标注的public void方法执行之后执行 |
| @Test – 使用该注解标注的public void方法会表示为一个测试方法 |
Jsoup
| |
| <dependency> |
| <groupId>org.jsoup</groupId> |
| <artifactId>jsoup</artifactId> |
| <version>1.14.3</version> |
| </dependency> |
JDBC
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.32</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>8.0.30</version> |
| </dependency> |
| |
Servlet 、jsp <=9
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>javax.servlet-api</artifactId> |
| <version>3.1.0</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet.jsp</groupId> |
| <artifactId>jsp-api</artifactId> |
| <version>2.1</version> |
| <scope>provided</scope> |
| </dependency> |
Servlet 、jsp >=10
| |
| |
| <dependency> |
| <groupId>jakarta.servlet</groupId> |
| <artifactId>jakarta.servlet-api</artifactId> |
| <version>5.0.0</version> |
| <scope>provided</scope> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>jakarta.servlet.jsp</groupId> |
| <artifactId>jakarta.servlet.jsp-api</artifactId> |
| <version>3.0.0</version> |
| <scope>provided</scope> |
| </dependency> |
| |
JSTL [javax]
| |
| <dependency> |
| <groupId>jstl</groupId> |
| <artifactId>jstl</artifactId> |
| <version>1.2</version> |
| </dependency> |
| |
JSTL [jakarta]
| |
| <dependency> |
| <groupId>org.glassfish.web</groupId> |
| <artifactId>jakarta.servlet.jsp.jstl</artifactId> |
| <version>2.0.0</version> |
| </dependency> |
| |
| |
| |
| |
| |
| |
MyBatis
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.5.6</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>5.2.5.RELEASE</version> |
| </dependency> |
| |
logback
| |
| <dependency> |
| <groupId>ch.qos.logback</groupId> |
| <artifactId>logback-classic</artifactId> |
| <version>1.2.11</version> |
| <scope>test</scope> |
| </dependency> |
| |
dom4j
| |
| <dependency> |
| <groupId>org.dom4j</groupId> |
| <artifactId>dom4j</artifactId> |
| <version>2.1.3</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>jaxen</groupId> |
| <artifactId>jaxen</artifactId> |
| <version>1.2.0</version> |
| </dependency> |
| |
javassist
| |
| <dependency> |
| <groupId>org.javassist</groupId> |
| <artifactId>javassist</artifactId> |
| <version>3.29.0-GA</version> |
| </dependency> |
| |
spring context 6.0.0-M2
| |
| <repositories> |
| <repository> |
| <id>repository.spring.milestone</id> |
| <name>Spring Milestone Repository</name> |
| <url>https://repo.spring.io/milestone</url> |
| </repository> |
| </repositories> |
| |
| <dependencies> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>6.0.0-M2</version> |
| </dependency> |
| </dependencies> |
spring-context 5.318
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>5.3.18</version> |
| </dependency> |
| |
spring-aspects
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-aspects</artifactId> |
| <version>6.0.0-M2</version> |
| </dependency> |
| |
annotation-api
使用@Resource需要引入
Spring6+版本
| <dependency> |
| <groupId>jakarta.annotation</groupId> |
| <artifactId>jakarta.annotation-api</artifactId> |
| <version>2.1.1</version> |
| </dependency> |
Spring其他版本
| <dependency> |
| <groupId>javax.annotation</groupId> |
| <artifactId>javax.annotation-api</artifactId> |
| <version>1.3.2</version> |
| </dependency> |
spring-webmvc
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>6.0.4</version> |
| </dependency> |
jackson-databind
| |
| <dependency> |
| <groupId>com.fasterxml.jackson.core</groupId> |
| <artifactId>jackson-databind</artifactId> |
| <version>2.14.1</version> |
| </dependency> |
| |
SSM
Spring 6.0.4
Tomcat 10.0.20
Mybatis 3.5.1
Mysql-jdbc 8.0.30
| <?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.nfjh</groupId> |
| <artifactId>springmvc_06_SSM</artifactId> |
| <version>1.0</version> |
| <packaging>war</packaging> |
| |
| |
| <repositories> |
| <repository> |
| <id>repository.spring.milestone</id> |
| <name>Spring Milestone Repository</name> |
| <url>https://repo.spring.io/milestone</url> |
| </repository> |
| </repositories> |
| |
| |
| |
| <properties> |
| <junit.version>4.12</junit.version> |
| <spring.version>6.0.4</spring.version> |
| <mybatis.version>3.5.1</mybatis.version> |
| |
| <mybatis.spring.version>2.1.0</mybatis.spring.version> |
| <mybatis.paginator.version>1.2.15</mybatis.paginator.version> |
| |
| <mysql.version>8.0.30</mysql.version> |
| <slf4j.version>1.6.4</slf4j.version> |
| <druid.version>1.1.12</druid.version> |
| <pagehelper.version>5.1.2</pagehelper.version> |
| |
| <jakarta.jstl.version>2.0.0</jakarta.jstl.version> |
| <jakarta.servlet-api.version>5.0.0</jakarta.servlet-api.version> |
| <jakarta.jsp-api.version>3.0.0</jakarta.jsp-api.version> |
| |
| <jackson.version>2.9.6</jackson.version> |
| |
| </properties> |
| |
| |
| <dependencies> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-beans</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-aspects</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jms</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context-support</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-test</artifactId> |
| <version>${spring.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>${mybatis.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>${mybatis.spring.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>com.github.miemiedev</groupId> |
| <artifactId>mybatis-paginator</artifactId> |
| <version>${mybatis.paginator.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>com.github.pagehelper</groupId> |
| <artifactId>pagehelper</artifactId> |
| <version>${pagehelper.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>${mysql.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.alibaba</groupId> |
| <artifactId>druid</artifactId> |
| <version>${druid.version}</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <version>${junit.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| |
| |
| <dependency> |
| <groupId>org.glassfish.web</groupId> |
| <artifactId>jakarta.servlet.jsp.jstl</artifactId> |
| <version>${jakarta.jstl.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>jakarta.servlet</groupId> |
| <artifactId>jakarta.servlet-api</artifactId> |
| <version>${jakarta.servlet-api.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>jakarta.servlet.jsp</groupId> |
| <artifactId>jakarta.servlet.jsp-api</artifactId> |
| <version>${jakarta.jsp-api.version}</version> |
| <scope>provided</scope> |
| </dependency> |
| |
| |
| |
| <dependency> |
| <groupId>com.fasterxml.jackson.core</groupId> |
| <artifactId>jackson-databind</artifactId> |
| <version>${jackson.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.json</groupId> |
| <artifactId>json</artifactId> |
| <version>20140107</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>commons-io</groupId> |
| <artifactId>commons-io</artifactId> |
| <version>2.4</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-fileupload</groupId> |
| <artifactId>commons-fileupload</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| |
| |
| |
| |
| |
| |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-simple</artifactId> |
| <version>${slf4j.version}</version> |
| </dependency> |
| |
| </dependencies> |
| |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <configuration> |
| <source>1.8</source> |
| <target>1.8</target> |
| <encoding>UTF-8</encoding> |
| </configuration> |
| </plugin> |
| </plugins> |
| |
| <resources> |
| <resource> |
| <directory>src/main/java</directory> |
| <includes> |
| <include>**/*.properties</include> |
| <include>**/*.xml</include> |
| </includes> |
| <filtering>false</filtering> |
| </resource> |
| <resource> |
| <directory>src/main/resources</directory> |
| <includes> |
| <include>**/*.properties</include> |
| <include>**/*.xml</include> |
| </includes> |
| <filtering>false</filtering> |
| </resource> |
| </resources> |
| </build> |
| |
| |
| </project> |
| |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?