问题描述: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>