首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

解决maven构建eclipse项目中的异常

2012-09-12 
解决maven构建eclipse项目中的错误由于最近把开发环境进行了升级,如svn、eclipse、和maven,都升级到了最新版

解决maven构建eclipse项目中的错误

由于最近把开发环境进行了升级,如svn、eclipse、和maven,都升级到了最新版本。感觉效果很好。但是今天在利用maven构建之前的一个版本的项目时报如下错误:

mvn eclipse:eclipse -e

[INFO] Trace?
org.apache.maven.lifecycle.LifecycleExecutionException: Request to merge when ‘filtering’ is not identical. Original=resource src/main/resources: output=target/classes, include=[**/*.properties], exclude=[**/*.java], test=false, filtering=true, merging with=resource src/main/resources: output=target/classes, include=[], exclude=[**/*.java], test=false, filtering=false

?

?

??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)?
??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)?
??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
??? at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)?
??? at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)?
??? at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)?
??? at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)?
??? at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)?
??? at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)?
??? at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)?
??? at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)?
??? at java.lang.reflect.Method.invoke(Method.java:597)?
??? at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)?
??? at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)?
??? at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)?
??? at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

我查找相关资料,知道是由于升级导致的错误。利用降低maven到2.6即可:

 mvn org.apache.maven.plugins:maven-eclipse-plugin:2.6:eclipse

这样就可以成功构建了。

也可以修改pom文件:

<build>...  <plugins>  ...    <plugin>      <groupId>org.apache.maven.plugins</groupId>      <artifactId>maven-eclipse-plugin</artifactId>      <version>2.6</version>    </plugin>  </plugins></build>

这样你利用

mvn eclipse:eclipse也可以构建成功。

参考文档:

http://stackoverflow.com/questions/1397903/setting-project-for-eclipse-using-maven

?

热点排行