eclipse maven工程错误总汇
1、问题:
Target runtime Apache Tomcat v7.0 is not defined
解决方法:
right click on your project > Properties > Targeted Runtime > Click the version required 8.0
相关资料:
2、问题:
Maven项目中的Dynamic Web Module 3.0 requires Java 1.6 or newer
解决方法
在项目的pom.xml的 build 标签中加入:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
相关资料:
http://blog.csdn.net/liuxinghao/article/details/37088063
3、问题
Cannot change version of project facet Dynamic web module to 3.0
解决方法
打开工程目录下的.settings文件夹中的 org.eclipse.wst.common.project.facet.core.xml文件修改标签 facet="jst.web" 中的version版本为3.0,
修改后如下所示:
<faceted-project>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="jst.jaxrs" version="2.0"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.jsf" version="2.2"/>
</faceted-project>
4、问题
cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation- driven'
解决办法
在 spring-mybatis.xml的标签 http://www.springframework.org/schema/context/spring-context-3.5.xsd 中,去掉后面的版本号 。
5、问题
Failed to read artifact descriptor for org.springframework:spring-orm:jar:${spring.version}
解决办法
因为上面jar包的版本是用变量定义的,所有需要定义变量的版本号,下面就是定义spring的包的版本号。
<properties>
<spring.version>3.1.1.RELEASE</spring.version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
6、问题
Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml]
解决办法
在WEB-INF文件夹中找到web.xml,在该文件中添加server配置,如下所示:
<!-- 前端控制器 -->
<servlet>
<!-- 名称,真实的文件名需要在这个名字后面加上-servlet后缀 -->
<servlet-name>spring-mvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<!--设置spring-mvc.xml文件路径,确保和文件名相同-->
<param-value>classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
spring-mvc.xml 配置文件在src/main/resource文件夹中。用于启动对应的控制器(controller),核心配置如下:
<context:component-scan base-package="com.bicycleway.controller" />
base-package 后面的内容要和服务类相同,如下图所示:
7.问题
1、Failed to read artifact descriptor
2、Cannot find the declaration of element 'beans'.
解决办法
在更新项目的时候,勾选 "Force Update of Snapshot/Releases",如下图所示:

8、java.lang.NullPointerException
可能是方法没有真确的调用,调用的服务没有使用@Resource
笔记
1、maven插件和仓库配置
打开下载下来的maven包的settings.xml文件,路径如下:F:\workspace\apache-maven-3.3.9\conf
配置仓库地址,如下图:
网络资源:
http://stackoverflow.com/questions/23290699/cvc-complex-type-2-4-c-the-matching-wildcard-is-strict-but-no-declaration-can
https://stackoverflow.com/questions/18145774/eclipse-an-error-occurred-while-filtering-resources
9、
Cannot change version of project facet Dynamic web module to 2.5
将web.xml进行修改:
修改前:
!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>
修改后:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>Archetype Created Web Application</display-name>
</web-app>
eclipse maven工程错误总汇的更多相关文章
- eclipse maven项目错误
eclipse maven项目错误:Failure to transfer org.codehaus.plexus:plexus-interpolation:jar:1.15 from http:// ...
- Maven 工程错误Failure to transfer org.codehaus.plexus:plexus-io:pom:1.0,Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1
原本好好的Maven工程却出现了莫名的错误 Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1 from http:// ...
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.5.0:system 解决方法
今天同事在使用eclipse,引入一个新的maven工程时报错: Missing artifact com.sun:tools:jar:1.6.0:system 这个问题很奇怪,相同的代 ...
- (转) Eclipse Maven 编译错误 Dynamic Web Module 3.1 requires Java 1.7 or newer 解决方案
场景:在导入Maven项目时候遇到如下错误. 1 问题描述及解决 Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Loca ...
- Eclipse Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer 解决方案
Eclipse Maven 开发一个 jee 项目时,编译时遇到以下错误:Description Resource Path Location TypeDynamic Web Module 3.0 r ...
- 导入maven工程错误
有时候导入maven工程会报空指针异常: An internal error occurred during: “Updating Maven Project”. java.lang.NullPoin ...
- 解决eclipse maven工程中src/main/resources目录下创建的文件夹所显示样式不是文件夹,而是"包"图标样式的问题
参考:http://blog.csdn.net/luwei42768/article/details/72268246 eclipse项目中创建maven项目后,有时在执行命令maven update ...
- eclipse maven工程打包失败
报错如下: Maven install失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:comp ...
- Eclipse maven工程 Missing artifact com.sun:tools:jar:1.7.0:system 解决方法
解决方案一:通过maven取运行时参数,eclipse提供的环境变量,基本类似System.getProperty("java.home") <dependency> ...
随机推荐
- JavaScript引用类型和基本类型的区别
JavaScript变量可以用来保存的两种类型的值:基本类型值和引用类型值. 基本类型值有5种类型:undefined,null,boolean,number,string 引用类型值有两种类型:函数 ...
- 微信小程序 view中的image水平垂直居中
当 display: flex 配合 justify-content: center 使用时可以让view水平居中 而配合 align-items: center 用时可以实现垂直居中效果 .card ...
- js实现div的碰壁反弹效果
文章地址 https://www.cnblogs.com/sandraryan/ 需求: 写一个div,让div在父级进行匀速运动,碰到父级上下左右的边框,就向反方向运动. 碰壁反弹在游戏制作中很常用 ...
- HTTP协议---三次握手
HTTP协议 关于协议 对于应用层开发人员,接触最多的网络协议通常都是传输层的TCP,为什么这么说,因为再往上的应用层协议,如:HTTP.HTTPS.POP3.SMTP.RPC.FTP.TELNE ...
- linux预备知识
我们正在接近去看一些实际的模块代码. 但是首先, 我们需要看一些需要出现在你的模块 源码文件中的东西. 内核是一个独特的环境, 它将它的要求强加于要和它接口的代码上. 大部分内核代码包含了许多数量的头 ...
- Total Commander 显示文件包含文件名扩展
在默认的 Total Commander 是分开文件名和文件扩展,如果想要让文件名同时显示扩展,可以通过设置合并文件名和扩展两列 点击配置,在选项的制表修改显示 How to configure To ...
- 多校 HDU - 6614 AND Minimum Spanning Tree (二进制)
传送门 AND Minimum Spanning Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 ...
- vue-cli常用插件集合
element - 饿了么出品的Vue2的web UI工具套件 Vux - 基于Vue和WeUI的组件库 mint-ui - Vue 2的移动UI元素 iview - 基于 Vuejs 的开源 UI ...
- SPOJ - REPEATS Repeats (后缀数组)
A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed strin ...
- Java虚拟机-类文件结构
目录 类文件结构 Class类文件的结构 魔数与Class文件的版本 常量池 访问标志 类索引.父类索引和接口索引集合 字段表集合 方法表集合 属性表集合 完整结构描述 实例 源码 Class文件 分 ...