Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 416625

Summary: P2 update site can't be read by tycho
Product: [Tools] GEF Reporter: Christophe Bouhier <dzonekl>
Component: RelEngAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: mjmeijer, nobody, nyssen
Version: unspecified   
Target Milestone: 3.9.100 (Luna) M5   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Christophe Bouhier CLA 2013-09-05 09:42:44 EDT
Hi, 

Maven/Tycho doesn't like your P2. 


Error: 

Failed to load p2 metadata repository from location http://download.eclipse.org/tools/gef/updates/releases/: The p2 repository at http://download.eclipse.org/tools/gef/updates/releases contains units from an old style update site which cannot be used for dependency resolution -> [Help 1]


Reproduce: 

1. Make a mvn pom.xml for an eclipse feature which refers org.eclipse.gef and org.eclipse.draw2d features. 
2. let tycho resolve these dependencies.
Comment 1 Alexander Nyßen CLA 2013-09-19 09:14:12 EDT
Could you add an example pom to reproduce this? We use tycho to produce the update-site so I cannot really reproduce this...
Comment 2 Christophe Bouhier CLA 2013-12-17 04:11:54 EST
Hi Alex, 

I realise I don't have a specific feature for gef plugins. I use the feature provided by gef in a .product file. Then I have a .target definition with the GEF URL as a repository in it. The product has a pom.xml as explained in the tycho reference card. 


http://wiki.eclipse.org/Tycho/Reference_Card#Products

I won't provide an example for all this, I have self-published GEF so it works for me. Sorry..
Comment 3 maarten meijer CLA 2013-12-25 07:59:53 EST
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'gef-releases' from location http://download.eclipse.org/tools/gef/updates/releases/: The p2 repository at http://download.eclipse.org/tools/gef/updates/releases contains partial IUs (see above) from an old style update site which cannot be used for dependency resolution -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'gef-releases' from location http://download.eclipse.org/tools/gef/updates/releases/
	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 'gef-releases' from location http://download.eclipse.org/tools/gef/updates/releases/
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:300)
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:268)
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:166)
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:119)
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
	at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.computeTargetPlatform(P2TargetPlatformResolver.java:215)
	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: The p2 repository at http://download.eclipse.org/tools/gef/updates/releases contains partial IUs (see above) from an old style update site which cannot be used for dependency resolution
	at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.failIfRepositoryContainsPartialIUs(RemoteMetadataRepositoryManager.java:79)
	at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:60)
	at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52)
	at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:296)
	... 20 more
Comment 4 Alexander Nyßen CLA 2014-01-06 15:57:34 EST
It seems this is related to the respective Tycho version. I could reproduce it with a recent Tycho version.
Comment 5 Christophe Bouhier CLA 2014-01-07 02:50:56 EST
I had this problem with Tycho version 0.18. 
0.19 is out, no clue if this solves the problem.
Comment 6 Nobody - feel free to take it CLA 2014-01-09 07:18:23 EST
I am using tycho 0.19.0, and the problem exists.
Please note that tycho refuses to use old-style repos since 0.18.1
see http://wiki.eclipse.org/Tycho/Release_Notes/0.18 for more details.
Interestingly http://download.eclipse.org/tools/gef/updates/milestones/ seems to work, while http://download.eclipse.org/tools/gef/updates/releases/ is not.

You can find a non-working pom here: https://github.com/magwas/zenta/blob/GEFProblemReport/pom.xml
If you rewind that branch with one commit, there is a working pom, pointing at milestones instead of releases.

I propose to reindex the repo, this post might help in it:

http://tonnymadsen.blogspot.hu/2013/05/tycho-and-pre-p2-update-sites.html

And thanks for this great software!
Comment 7 Nobody - feel free to take it CLA 2014-01-09 07:23:47 EST
> Please note that tycho refuses to use old-style repos since 0.18.1
No, since 0.18
Comment 8 Alexander Nyßen CLA 2014-01-18 07:08:29 EST
I can reproduce the issue, however I do not see while /tools/gef/updates/releases should be an old-style repo. It contains artifacts.jar and contents.jar just like /tools/gef/updates/milestones, and there is no site.xml. In fact, the sites are published by the same publish script, which uses org.eclipse.equinox.p2.artifact.repository.mirrorApplication to add the contents of a respective Hudson build repository (which is in turn produced by Tycho).
Comment 9 Nobody - feel free to take it CLA 2014-01-19 00:42:04 EST
A wild guess: what if one of the releases is an old style one?
Comment 10 Alexander Nyßen CLA 2014-01-19 10:25:49 EST
(In reply to Ãrpád Magosányi from comment #9)
> A wild guess: what if one of the releases is an old style one?

Yes, it seems so. However, I already re-built the releases site when migrating the GEF build to Tycho, so the meta-data actually should actually have been ok. 

Nevertheless, I re-created the releases site and ensured it can be consumed by Tycho before uploading it to downloads.eclipse.org. The prior contents of the releases update-site is still available under updates/releases_pre_416625  (I will remove it when we have successfully published the Kepler SR2 release and no complaints are reported). It will probably need some time until all mirrors are properly updated.
Comment 11 Nobody - feel free to take it CLA 2014-01-20 03:07:22 EST
I can confirm that http://download.eclipse.org/tools/gef/updates/releases/ works with tycho 0.19.0.

Thank you.
Comment 12 Alexander Nyßen CLA 2014-01-20 03:23:32 EST
Resolving as fixed then.