如何在Tycho构建中使用site.xml基本更新站点

时间:2014-03-25 08:24:29

标签: maven tycho apacheds update-site

我的项目依赖于Apache Directory Studio插件。我创建了一个pom.xml文件,并添加了Apache Directory Studio更新站点作为存储库。但是,Tycho无法加载Apache Directory Studio更新站点。

该网站不是p2存储库,但只有site.xml。如何在我的构建中使用此站点?


从主pom.xml文件中提取:

<repositories>
    <repository>
          <id>kepler</id>
          <layout>p2</layout>
          <url>http://download.eclipse.org/releases/kepler</url>
    </repository>
    <repository>
         <id>apacheds</id>
         <layout>p2</layout>
         <url>http://directory.apache.org/studio/update/2.x</url> <!-- old-style update site -->
    </repository>
    <repository>
         <id>gef</id>
         <layout>p2</layout>
         <url>http://download.eclipse.org/tools/gef/updates/releases</url>
    </repository>
    <repository>
         <id>nebula</id>
         <layout>p2</layout>
         <url>http://download.eclipse.org/technology/nebula/incubation/snapshot</url>
    </repository>
</repositories>

来自mvn clean verify的错误消息:

[INFO] Fetching site.xml from http://directory.apache.org/studio/update/2.x/ (0B at 0B/s) 

[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'apacheds' from locationhttp://directory.apache.org/studio/update/2.x: No repository found at http://directory.apache.org/studio/update/2.x. - [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'apacheds' from location http://directory.apache.org/studio/update/2.x
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:168)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.RuntimeException: Failed to load p2 repository with ID 'apacheds' from location http://directory.apache.org/studio/update/2.x
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:296)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:266)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:164)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:117)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
    at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.computeTargetPlatform(P2TargetPlatformResolver.java:214)
    at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:100)
    at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:274)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    ... 11 more
Caused by: org.eclipse.equinox.p2.core.ProvisionException: No repository found at http://directory.apache.org/studio/update/2.x.
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:395)
    at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:692)
    at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
    at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:59)
    at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52)
    at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:292)
    ... 20 more

1 个答案:

答案 0 :(得分:0)

Tycho无法针对旧式更新站点进行构建。旧版Update Manager的更新站点格式(在Galileo版本中被BT替换为BTW,即2009年)仅包含site.xml索引文件,该文件不包含用于Tycho依赖性解析的足够元数据。

有两种方法可以解决这个问题:

  • 要求网站的提供商以p2存储库格式提供其内容。
  • 自己将旧网站格式转换为p2存储库,将其放在HTTP服务器上,然后引用转换后的网站。

转换可以使用简单的存根项目described here完成。