注意是maven的webapp:
选择maven下一步下一步。
maven下载过慢在setting中加入镜像。 我也有疑问这是什么鬼格式,但是证明,格式不用调整,直接粘贴进去:
<mirror> <id> nexus-aliyun </id> <mirrorOf> * </mirrorOf> <name> Nexus aliyun </name> <url> http://maven.aliyun.com/nexus/content/groups/public </url> </mirror>
我在这里踩了一个特郁闷的坑,注意看这里,没有package war, 这里有毒,导致我的tomcat一直加不进去artifacts
暂时就是这个鬼样子的结构,手动补全结构,
调整一下包:
加入和pom中的依赖 和 web.xml和 springmvc.xml
注意这里别丢了 pom:
pom.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.shishi</groupId> <artifactId>mymvc</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> <spring-version>5.2.8.RELEASE</spring-version> </properties> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring-version}</version> </dependency> <d<i style="color:transparent">本文来源gaodai$ma#com搞$$代**码网$</i>ependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.2.8.RELEASE</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.1</version> </dependency> </dependencies> </project>