java - 使用 Tycho/Maven 构建 RAP 会出现 DuplicateReactorIUsException

标签 java maven tycho eclipse-rap

我正在艰难地使用 Tycho 让 Maven 编译我的基于 OSGi 的 RAP 应用程序。我想我几乎已经把所有东西粘在一起了,但是有一个错误我无法修复,因为我不知道它来自哪里。 使用工作目录根目录中的任何 Maven 命令,我都会收到以下错误:

[ERROR] Internal error: org.eclipse.tycho.p2.target.DuplicateReactorIUsException: Duplicate reactor project IUs.
[ERROR] de.andre.osgitest 0.0.1.qualifier => [C:\eclipse\modeling\pomws\de.andre.osgitest, C:\eclipse\modeling\pomws\de.andre.osgitest.product]
[ERROR] -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.p2.target.DuplicateReactorIUsException: Duplicate reactor project IUs.
de.andre.osgitest 0.0.1.qualifier => [C:\eclipse\modeling\pomws\de.andre.osgitest, C:\eclipse\modeling\pomws\de.andre.osgitest.product]

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.tycho.p2.target.DuplicateReactorIUsException: Duplicate reactor project IUs.
de.andre.osgitest 0.0.1.qualifier => [C:\eclipse\modeling\pomws\de.andre.osgitest, C:\eclipse\modeling\pomws\de.andre.osgitest.product]

        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.getPreliminaryReactorProjectUIs(TargetPlatformFactoryImpl.java:376)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:179)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:128)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
        at org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform(ReactorRepositoryManagerImpl.java:84)
        at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:223)
        at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
        at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        ... 11 more

项目结构如下:

root
|de.andre.osgitest
|  |src
|  |  | ...
|  |
|  |META-INF
|  |  | MANIFEST.MF
|  |
|  |OSGI-INF
|  |  | contribution.xml
|  |
|  |WEB-INF
|  |  | launch.ini
|  |  | web.xml
|  |
|  |- build.properties
|  |- de.andre.osgitest.launch
|  |- osgitest.target
|  |- pom.xml
|
|de.andre.osgitest.feature
|  |rootfiles
|  |  |lib
|  |  |  |- org.eclipse.equinox.servletbridge_1.3.0.v20140430-1556.jar
|  |  |
|  |  |- launch.ini
|  |  |- web.xml
|  |
|  |- pom.xml
|  |- feature.xml
|  |- build.properties
|
|de.andre.osgitest.product
|  |- pom.xml
|  |- osgitest.product
|  |- assembly.xml
|
|- pom.xml

因为 pom.xml 对于这个线程来说太多了,我将引用 http://pastebin.com/S7AM7hbW在这里。

我希望你们中的一位聪明人有一个想法。

干杯,安德烈

最佳答案

看来您需要确保所有 artifactId 都是唯一的 ( http://software.2206966.n2.nabble.com/Does-artifact-id-really-have-to-be-globally-unique-0-10-regression-td5630018.html )。

我通常使用这种模式:

<groupId>com.example.product</groupId> 
<artifactId>com.example.product.bundle1</artifactId>

<groupId>com.example.product</groupId> 
<artifactId>com.example.product.bundle2</artifactId>

其中 artifactId 与 bundle Bundle-SymbolicName 匹配。

关于java - 使用 Tycho/Maven 构建 RAP 会出现 DuplicateReactorIUsException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31878776/

相关文章:

Java Printf 对齐输出

java - 在 Windows 7 操作系统上使用 EvoSuite 插件

maven - Java 二进制文件的 Sonarqube 无效值

rcp - 构建 RCP 应用程序时在第谷中进行 p2.inf 过滤

eclipse - Maven 与 OSGI 和非 OSGI 项目

java - 为什么 Google Guice 无法初始化 i18n 对象并给我 null

java - 中序遍历 BST 并将其添加到列表中

构建正常的 struts 登录应用程序时出现 java.lang.ClassNotFoundException : org. apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

java - 如何在 Maven 中使用带有通配符的 CXF wsdl 客户端生成?

maven - 使用 Maven/Tycho 从远程存储库中的功能组装 Eclipse 产品