0

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

[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也无济于事。我真的卡住了,所以我希望有人能帮助我吗?

问候

4

2 回答 2

0

一位外部顾问向我展示了解决方案。

解决方案:标记目标项目并选择“属性”。然后选择“Java Build Path”,然后选择“库”选项卡。在那里我可以看到 Eclipse 使用了 JRE 1.5.0_12。我选择了它并按下了“编辑”按钮,所以确实出现了另一个菜单。有三个单选按钮('执行环境','Alternate JRE'和'Workspace default JRE (jdk1.6.0_16)'。默认是启用第一个选项。启用第三个选项后,我的问题已经消失了。

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

于 2012-07-06T13:58:39.233 回答
0

我假设你使用 m2eclipse。如果是这样,也许您使用嵌入式 Maven 实例(请参阅 m2eclipse 首选项),这是您在 Eclipse 之外使用的 Maven 实例之外的另一个版本?

于 2012-06-14T15:11:13.280 回答