文章目录
- 一:解决idea application context not configured for this file的问题
- 二:在Maven项目中通过Add Frameworks Support添加spring、springMVC等配置文件后,配置文件会有错误。只需将配置文件相应部分修改后便可以了。
- 三:在编写Maven的pom.xml文件时,需要在元素中添加相应代码,不然Maven找不到某些xml文件
- 四:Intellij IDEA 快速添加maven依赖
- 五:用Maven创建的项目中无法“import javax.servlet.http.HttpSession”,要给Maven的依赖添加tomcat的Libraries
- 六:因为Maven和IDEA版本不符合相关规则,导致Even Log报错“Unable to import Maven project: See logs for details”
一:解决idea application context not configured for this file的问题
spring配置文件中时常会出现这个提示,翻译过来大概意思就是没有配置该文件到项目中于是进入到file-Project Structure中查看可以很明显的看到下面有个感叹号,大概意思是下面的文件没有匹配
二:在Maven项目中通过Add Frameworks Support添加spring、springMVC等配置文件后,配置文件会有错误。只需将配置文件相应部分修改后便可以了。
- spring配置文件
- springMVC配置文件
- web.xml配置文件
代码如下:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1"
三:在编写Maven的pom.xml文件时,需要在元素中添加相应代码,不然Maven找不到某些xml文件
例如:Invalid bound statement (not found):com.test…
需要在pom.xml文件中添加一下代码
代码如下:
<!--让Maven找到相关的配置文件-->
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
四:Intellij IDEA 快速添加maven依赖
- 打开项目的pom.xml文件,按下快捷键Alt+insert,弹出Generate框,选择Dependency。
- 搜索所需jar的关键字。
五:用Maven创建的项目中无法“import javax.servlet.http.HttpSession”,要给Maven的依赖添加tomcat的Libraries
六:因为Maven和IDEA版本不符合相关规则,导致Even Log报错“Unable to import Maven project: See logs for details”
Maven版本
IDEA版本
Maven的版本要是2018.2.4之前的版本
之后在setting中修改Maven的home driectory