eclipse 创建maven项目中遇到的错误

错误1、
   问题描述:eclipse 创建maven项目时,pom.xml文件报错下面这个错-----Multiple annotations found at this line: - CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or o...
   解决方法:
   1、在pom.xml文件中加入maven-resources-plugin配置
<dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.4.3</version>
</dependency>
2、在命令行下运行mvn install ,如果执行正确应该会在{user.home}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\下看到maven-resources-plugin-2.4.3.jar文件
3、刷新工程(右键工程选择刷新项)
4、刷新maven配置,右键工程节点,选择Maven4MyEclipse-Update Project Configuration


错误2、
    问题描述:eclipse 创建maven项目时,pom.xml文件报错下面这个错-----
    Failure to transfer org.codehaus.plexus:plexus-archiver:jar:2.0.1 from http://repo.maven.apache.org/
 maven2 was cached in the local repository, resolution will not be reattempted until the update interval 
 of central has elapsed or updates are forced. Original error: Could not transfer artifact 
 org.codehaus.plexus:plexus-archiver:jar:2.0.1 from/to central (http://repo.maven.apache.org/maven2): 
 No response received after 60000
    解决方法:
1.先去掉Maven工程的maven特性,选中工程 鼠标右键-->Maven-->Disable Maven Nature. 此步骤后pom.xml错误消失


2.为工程增加Maven特性,选中工程 鼠标右键-->Configure-->Convert to Maven Project.


经过上述步骤,Maven工程就正常了。


错误3、
Eclipse Maven 编译错误 Dynamic Web Module 3.0 requires Java 1.6 or newer  
----- 这是由于你的 Maven 编译级别是 jdk1.5 或以下,而你导入了 jdk1.6 以上的依赖包
。解决方案:
1、项目的编译级别设置为 1.7
2、使用 maven-compiler-plugin 将 maven 编译级别改为 jdk1.6 以上:
<build>  
    <plugins>  
        <!-- define the project compile level -->  
        <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>  
</build>  


错误4、
Mappingjacksonhttpmessageconverter  类找不到
-----在spring4.X中删除了啊MappingJacksonHttpMessageConverter类文件,可以使用MappingJackson2HttpMessageConverter替换但是启动仍然会报异常
Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/JsonProcessingException 解决办法是在pom文件中引入一下jar包
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-core</artifactId>
   <version>2.5.1</version>
</dependency>
<dependency>
   <groupId>com.fasterxml.jackson.core</groupId>
   <artifactId>jackson-databind</artifactId>
   <version>2.5.1</version>
</dependency>


  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值