Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] dependencies not found in p2 repo build

See inline.

Regards
Tobias

> -----Original Message-----
> From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-
> bounces@xxxxxxxxxxx] On Behalf Of Tim Harsch
> Sent: Donnerstag, 30. Mai 2013 01:41
> To: Tycho user list
> Subject: Re: [tycho-user] dependencies not found in p2 repo build
> 
> Right, that's what I think I'm coming to understand.  So...
> 
> Case 1) It seems to me, it wouldn't have to be that way, if I could tell
> tycho that for this particular bundle, not to worry that it can't be
> resolved.  In other words, I know my plugin that requires sesame loads
> into the OSGI container and runs fine without opencsv, so why should tycho
> break the build?  Shouldn't tycho give special consideration to the fact
> that it is scope=runtime and not attempt to pull it in to the build?

Tycho assumes that you are building for a plain OSGi runtime without any pre-existing "runtime" scope dependencies. So any unsatisfied dependencies will cause the bundles to not be resolved in the OSGi runtime, and Tycho already detects this in the build. If you have a version of the bundle that does resolve at runtime, just make that available in the build, and the build should also pass.

> Case 2) If I do make the plain jar for opencsv a bundle, using
> maven-bundle-plugin, how would tycho know to use that one and not the one
> in my .m2 repo?  Since it is a transitive dependency tycho will download
> the jar at resolution time.  Unless, maybe, I delete it from repo, and
> install a custom one to the repo via install:install-file, but that seems
> like witchery to me.  Is there a way to tell tycho to use a directory
> location with precedence of the .m2 repo?
>
> Additionally, do the repositories of layout=p2 take any precedence over
> the local .m2? artifacts resolved from the p2 repos aren't cached in the
> .m2 local repo as far as I can tellÅ  so which gets searched first when
> <pomDependencies>consider</pomDependencies> is in effect?

If there are multiple ways to resolve a dependency, Tycho (or more precisely Tycho's embedded p2 resolver) will pick one according to a pretty complicated optimization function. If you need to have control, make sure to only have the bundles in the target platform that you need. E.g. for p2 repositories, you can kick out some of the bundles by using filters [1]. For Maven POM dependencies, you can exclude items from the transitive dependencies by using the standard Maven dependency syntax.

 
> Thanks,
> Tim
 
[1] http://wiki.eclipse.org/Tycho/Target_Platform#Filtering




> On 5/29/13 3:28 PM, "Igor Fedorenko" <igor@xxxxxxxxxxxxxx> wrote:
> 
> >Tycho can only directly consume OSGi bundles. Any plain jar dependencies
> >have to be converted to OSGi bundles first, using maven-bundle-plugin
> >for example, but this has to happen in a separate build. In other words,
> >you first need to create net.sf.opencsv:opencsv:2.0 bundle and
> >install/deploy it into a maven repository. Then your Tycho build will be
> >able to use pomDependency=consider to add dependency on it.
> >
> >--
> >Regards,
> >Igor
> >
> >On 2013-05-29 5:42 PM, Tim Harsch wrote:
> >> Hi all,
> >> According to the error below, au.com.bytecode.opencsv package cannot be
> >> found when I am building my p2 repo.  Tycho is pulling
> >> the org.openrdf.sesame2 2.7.0  package from my .m2 repo upon build.
> >>   This artifact has a dependency with scope=runtime
> >> to net.sf.opencsv:opencsv:2.0.  I tried manually including a dependency
> >> in my pom.xml for the p2 build, but that did not help.  When I cracked
> >> open the jar in my repo I noticed it's MANIFEST.MF does not export
> >> the au.com.bytecode.opencsv, in fact, it doesn't look to be a bundle at
> >> all.
> >>
> >> My guess is sesame bundle will work fine without it if I don't use any
> >> of the CSV functions.  So two questions:
> >>
> >>   * Can I tell tycho to not worry about it
> >>   * Could use maven-bundle-plugin to fix that jar (if it is really
> >>     needed) and configure tycho to use that jar instead of the one in
> my
> >>     .m2 repo?
> >>
> >>
> >> Thanks,
> >> Tim
> >>
> >>
> >> [ERROR] Cannot resolve project dependencies:
> >> [ERROR]   Software being installed: com.yarcdata.urika.urika-sesame-
> http
> >> 1.0.0.qualifier
> >> [ERROR]   Missing requirement: org.openrdf.sesame2 2.7.0 requires
> >> 'package au.com.bytecode.opencsv 0.0.0' but it could not be found
> >> [ERROR]   Cannot satisfy dependency:
> >> com.yarcdata.urika.urika-sesame-http 1.0.0.qualifier depends on:
> package
> >> info.aduna.iteration 2.7.0
> >> [ERROR]
> >> [ERROR] Internal error: java.lang.RuntimeException: "No solution found
> >> because the problem is unsatisfiable.": ["Unable to satisfy dependency
> >> from org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.2.v_OTDT_r211_201209011847 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.3.v_OTDT_r212_201301271217 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.openrdf.sesame2 2.7.0 to package
> >> au.com.bytecode.opencsv 0.0.0.", "No solution found because the problem
> >> is unsatisfiable."] -> [Help 1]
> >> org.apache.maven.InternalErrorException: Internal error:
> >> java.lang.RuntimeException: "No solution found because the problem is
> >> unsatisfiable.": ["Unable to satisfy dependency from
> >> org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.2.v_OTDT_r211_201209011847 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.3.v_OTDT_r212_201301271217 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.openrdf.sesame2 2.7.0 to package
> >> au.com.bytecode.opencsv 0.0.0.", "No solution found because the problem
> >> is unsatisfiable."]
> >> 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.jav
> a
> >>:39)
> >> at
> >>
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> I
> >>mpl.java:25)
> >> at java.lang.reflect.Method.invoke(Method.java:597)
> >> at
> >>
> >>org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launche
> r
> >>.java:290)
> >> at
> >>
> >>org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:2
> 3
> >>0)
> >> at
> >>
> >>org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launc
> h
> >>er.java:409)
> >> at
> >>org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352
> )
> >> Caused by: java.lang.RuntimeException: "No solution found because the
> >> problem is unsatisfiable.": ["Unable to satisfy dependency from
> >> org.eclipse.jdt.core 3.8.1.v_OTDT_r210_201206090452 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.2.v_OTDT_r211_201209011847 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.eclipse.jdt.core
> >> 3.8.3.v_OTDT_r212_201301271217 to
> >> org.eclipse.objectteams.otdt.core.patch.feature.group [2.0.0,3.0.0).",
> >> "Unable to satisfy dependency from org.openrdf.sesame2 2.7.0 to package
> >> au.com.bytecode.opencsv 0.0.0.", "No solution found because the problem
> >> is unsatisfiable."]
> >> at
> >>
> >>org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.newResolutionEx
> c
> >>eption(AbstractResolutionStrategy.java:98)
> >> at
> >>
> >>org.eclipse.tycho.p2.resolver.ProjectorResolutionStrategy.resolve(Projec
> t
> >>orResolutionStrategy.java:88)
> >> at
> >>
> >>org.eclipse.tycho.p2.resolver.AbstractResolutionStrategy.resolve(Abstrac
> t
> >>ResolutionStrategy.java:63)
> >> at
> >>
> >>org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2
> R
> >>esolverImpl.java:126)
> >> at
> >>
> >>org.eclipse.tycho.p2.impl.resolver.P2ResolverImpl.resolveDependencies(P2
> R
> >>esolverImpl.java:81)
> >> at
> >>
> >>org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.doResolvePlatform
> (
> >>P2TargetPlatformResolver.java:374)
> >> at
> >>
> >>org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.resolveDependenci
> e
> >>s(P2TargetPlatformResolver.java:350)
> >> at
> >>
> >>org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolvePr
> o
> >>ject(DefaultTychoDependencyResolver.java:109)
> >> at
> >>
> >>org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProject
> s
> >>Read(TychoMavenLifecycleParticipant.java:82)
> >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:273)
> >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
> >> ... 11 more
> >> [ERROR]
> >> [ERROR] To see the full stack trace of the errors, re-run Maven with
> the
> >> -e switch.
> >> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> >> [ERROR]
> >> [ERROR] For more information about the errors and possible solutions,
> >> please read the following articles:
> >> [ERROR] [Help 1]
> >> http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
> >>
> >>
> >>
> >> _______________________________________________
> >> tycho-user mailing list
> >> tycho-user@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/tycho-user
> >>
> >_______________________________________________
> >tycho-user mailing list
> >tycho-user@xxxxxxxxxxx
> >https://dev.eclipse.org/mailman/listinfo/tycho-user
> 
> _______________________________________________
> tycho-user mailing list
> tycho-user@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top