1. Maven给使用者的的约束:约定大于配置,我们之后可以能遇到我们写的配置文件,无法被导出或者生效的问题。资源文件最好在src/main/resources文件中加入项目资源,如果在Java中可能会出现无法导出的问题。老版本的IDEA创建文件夹需要手动去选择文件夹类型,新版本比较智能,创建的时候会智能的推荐你选择。
<!--在build中配置resources,来防止我们资源导出失败的问题-->
<build>
<resources>
<resource>
<!--这里是导出resources中的文件,并且建议所有的资源都在这里创建比较好-->
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<!--这里是导出java中的文件,不建议在这里面放入资源-->
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
将这段代码加入到pom.xml配置文件中就可以正常导出了。
2. 阿里云镜像,可以认为是下载加速器。这个在conf/setting.xml中添加到mirrors标签中。
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*,!jeecg,!jeecg-snapshots</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
3. 替换为webapp4.0版本和tomcat一致,将Servlet项目中的src/main/webapp/WEB-INF下的web.xml文件替换为最新版本的。
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
metadata-complete="true">
</web-app>
4. Maven仓库的使用,点击进入仓库