当前位置: 代码迷 >> java >> 使用Tycho / Maven构建RAP提供了DuplicateReactorIUsException
  详细解决方案

使用Tycho / Maven构建RAP提供了DuplicateReactorIUsException

热度:18   发布时间:2023-07-25 20:02:10.0

我正在努力使Maven通过使用Tycho来编译基于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对于该线程来说太多了,所以在这里我将参考 。

我希望其中一个聪明的人有个主意。

干杯,安德烈

似乎您需要确保所有artifactId都是唯一的( )。

我通常使用这种模式:

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

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

其中artifactId与捆绑包Bundle-SymbolicName相匹配。