[Bug 1216170] New: Tycho resolution issues when same upstream version exists in local repository
by Red Hat Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=1216170
Bug ID: 1216170
Summary: Tycho resolution issues when same upstream version
exists in local repository
Product: Fedora
Version: 22
Component: tycho
Severity: high
Priority: high
Assignee: rgrunber(a)redhat.com
Reporter: rgrunber(a)redhat.com
QA Contact: extras-qa(a)fedoraproject.org
CC: eclipse-sig(a)lists.fedoraproject.org,
java-sig-commits(a)lists.fedoraproject.org,
krzysztof.daniel(a)gmail.com, mat.booth(a)redhat.com,
mizdebsk(a)redhat.com, rgrunber(a)redhat.com
First of all, huge thanks to Alex for finding, and reproducing the issue!
A few things need to happen for this issue to occur. It won't affect "normal"
builds in mock, or even on Fedora Infrastructure, but it would affect users
that mix usage of mvn (for remote resolution) and xmvn -o (for system
resolution)
This will happen when executing xmvn -o clean verify when the following
conditions are met :
- A project building with Tycho has a requirement on the exact version of Tycho
present within Fedora.
- A user has attempted to build the project with mvn, causing remote (upstream)
Tycho artifacts to be installed to the local repository
Steps to reproduce :
(Make sure you have tycho, dbus-java and eclipse-platform installed)
1) git clone https://git.fedorahosted.org/git/eclipse-packagekit.git && pushd
eclipse-packagekit
2) xmvn -o clean verify
Notice how the project builds just fine, and specifically fedora-schemed repos
are resolved.
1) git clone https://git.fedorahosted.org/git/eclipse-packagekit.git && pushd
eclipse-packagekit
2) mvn clean verify (this will probably fail, on org.freedesktop.dbus and
that's fine as long as tycho artifacts have been resolved)
3) xmvn -o clean verify
Build fails with :
[INFO] Adding repository fedora:/usr/lib64/eclipse/plugins
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2
repository with ID '/usr/lib64/eclipse/plugins' from location
fedora:/usr/lib64/eclipse/plugins: No repository found at
fedora:/usr/lib64/eclipse/plugins. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error:
java.lang.RuntimeException: Failed to load p2 repository with ID
'/usr/lib64/eclipse/plugins' from location fedora:/usr/lib64/eclipse/plugins
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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: java.lang.RuntimeException: Failed to load p2 repository with ID
'/usr/lib64/eclipse/plugins' from location fedora:/usr/lib64/eclipse/plugins
at
org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:338)
at
org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:272)
at
org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:177)
at
org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:129)
at
org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
at
org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform(ReactorRepositoryManagerImpl.java:82)
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:229)
at
org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
at
org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:90)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:318)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
... 11 more
Caused by: org.eclipse.equinox.p2.core.ProvisionException: No repository found
at fedora:/usr/lib64/eclipse/plugins.
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:334)
... 21 more
The problem is that in
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-core/src/...
, Tycho attempts to resolve its OSGi runtime (tycho-bundles-external.zip) using
the Maven RepositorySystem. The resolution order is Reactor, Local, Workspace
(XMvn), Remote, and so the tycho-bundles-external.zip from the local repository
is used, which doesn't contain the org.fedoraproject.p2 bundle that our build
places in the Fedora version of tycho-bundles-external.zip, for resolution of
the fedora-schemed repos.
Easy workaround for now is to remove the path
'org/eclipse/tycho/tycho-bundles-external/' from your local repository (usually
$HOME/.m2/repository/)
Solution :
Our tycho-bundles-external.zip is significantly different from upstream's such
that we couldn't use theirs and place the org.fedoraproject.p2 bundle
elsewhere. Upstream ships the jars embedded in the zip while we ship symlinks
so as to avoid bundling. We need to change the resolution in
TychoOsgiRuntimeLoactor to use the XMvn resolver API rather than Maven's
RepositorySystem.
--
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=wfK5wUw4E1&a=cc_unsubscribe
8 years, 9 months