0

My project has dependencies on Apache Directory Studio plugins. I created a pom.xml file and added Apache Directory Studio update site as a repository. However, Tycho cannot load the Apache Directory Studio update site.

The site is not a p2 repository but only has a site.xml. How can I use this site in my build?


Extract from the master pom.xml file:

<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>

Error message from 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
oberlies
  • 11,503
  • 4
  • 63
  • 110
The_Cute_Hedgehog
  • 1,280
  • 13
  • 22

1 Answers1

1

Tycho cannot build against old-style update sites. The update site format of the old Update Manager (which was BTW replaced by p2 in the Galileo release, i.e. in 2009) only contains the site.xml index file, which doesn't include enough metadata for Tycho's dependency resolution.

There are two options to work around the problem:

  • Ask the providers of the site to offer their content in a p2 repository format.
  • Convert the old site format to a p2 repository yourself, put it on an HTTP server, and reference the converted site instead.

The conversion can be done with a simple stub project as described here.

oberlies
  • 11,503
  • 4
  • 63
  • 110