首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与Eclipse不同的行为

与Eclipse不同的行为
EN

Stack Overflow用户
提问于 2012-06-14 22:48:52
回答 2查看 1.2K关注 0票数 0

目前,我正在开发一个包含一些子项目的构建脚本。问题是使用eclipse的构建总是失败的。在下面的句子中,你可以读到Eclipse的注销:

代码语言:javascript
复制
[INFO] Reactor Summary:
[INFO] 
[INFO] CQ5 deployment Plugin ............................. SUCCESS [2.031s]
[INFO] Set up enviroment ................................. SUCCESS [0.000s]
[INFO] Hotfix packages for Communiqué .................... SUCCESS [0.406s]
[INFO] Archiva servlet ................................... SUCCESS [0.375s]
[INFO] Ldap Client ....................................... SUCCESS [0.422s]
[INFO] Hibernate ......................................... SUCCESS [7.719s]
[INFO] Main .............................................. SUCCESS [0.015s]
[INFO] Base .............................................. SUCCESS [0.000s]
[INFO] Core .............................................. FAILURE [1.578s]
[INFO] UI ................................................ SKIPPED
[INFO] Commons ........................................... SKIPPED
[INFO] Core .............................................. SKIPPED
[INFO] UI ................................................ SKIPPED
[INFO] Internet .......................................... SKIPPED
[INFO] Core .............................................. SKIPPED
[INFO] UI ................................................ SKIPPED
[INFO] Infothek .......................................... SKIPPED
[INFO] Core .............................................. SKIPPED
[INFO] UI ................................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.390s
[INFO] Finished at: Thu Jun 14 16:37:31 CEST 2012
[INFO] Final Memory: 17M/59M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.felix:maven-scr-plugin:1.7.2:scr (generate-scr-scrdescriptor) on project core: Execution generate-scr-scrdescriptor of goal org.apache.felix:maven-scr-plugin:1.7.2:scr failed: An API incompatibility was encountered while executing org.apache.felix:maven-scr-plugin:1.7.2:scr: java.lang.UnsupportedClassVersionError: Bad version number in .class file
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.felix:maven-scr-plugin:1.7.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/org/apache/felix/maven-scr-plugin/1.7.2/maven-scr-plugin-1.7.2.jar
[ERROR] urls[1] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
[ERROR] urls[2] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] urls[3] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[4] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[5] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/org/apache/felix/org.apache.felix.scr.generator/1.1.2/org.apache.felix.scr.generator-1.1.2.jar
[ERROR] urls[6] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/com/thoughtworks/qdox/qdox/1.12/qdox-1.12.jar
[ERROR] urls[7] = file:/c:/Dokumente%20und%20Einstellungen/reporter/.m2/repository/asm/asm-all/3.1/asm-all-3.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>de.xxx.cq5.ldap:Ldap:1.0.0, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

如果我在dos提示符中运行构建脚本,它将以成功的结果运行。

我使用的是Eclipse 3.7.1 (Indigeo)。我确保所有子项目都连接到相同的Java版本。即使清理工作区并运行mvn clean也没有帮助。我真的被困住了,所以我希望有人能帮我解决问题?

问候

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-07-06 21:58:39

一位外部顾问已经给我安排了解决方案。

解决方案:标记目标项目并选择“属性”。然后选择“Java Build Path”,然后选择“Libraries”选项卡。在那里我可以看到Eclipse使用了JRE。我选择了它并按下了“编辑”按钮,这样就出现了另一个菜单。有三个单选按钮(“执行环境”、“备用JRE”和“工作区默认1.5.0_12 (jdk1.6.0_16)”。默认是第一个启用的选项。启用第三个选项后,我的问题就解决了。

外部顾问认为这是Eclipse安装时间点的问题。然后我们将上面的jre 1.5定义为默认的运行时环境。显然,Eclipse将其视为“默认”版本。很奇怪..。

票数 0
EN

Stack Overflow用户

发布于 2012-06-14 23:11:13

我假设您使用的是m2eclipse。如果是这样的话,也许您使用的是嵌入式Maven实例(参见),并且这是与您在m2eclipse外部使用的Maven实例不同的版本?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11035668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档